Effective coverage reads function totals as line totals when the LLVM report has no branches

Aberta Para iniciantes
#95 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python, rust
Domínio
testing-qa

Direção de pesquisa

Comece com effective_coverage.parse_index_page_totals e reproduza o problema usando as linhas sintéticas de html_report/index.html na issue. Verifique como a função seleciona os totais e trata a célula de branches - (0/0). O trabalho estará concluído quando ela retornar linhas (1, 4) e branches (0, 0) para a reprodução, fazendo com que a cobertura efetiva de linhas use os totais de linhas.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug

Found while reviewing the user manual against the implementation at fe013fe. Reproduced by calling effective_coverage.parse_index_page_totals on a synthetic index page.

The effective-coverage path reads the totals from the LLVM HTML index page by taking the last three matches of NN.NN% (covered/total) in the page and treating them as function, line and branch totals. When the report contains no branches, llvm-cov renders the branch total as - (0/0), which does not match. The last three matches are then shifted by one cell: the function totals are read as line totals and the line totals as branch totals.

Reproduction

html_report/index.html whose only rows are

<tr><td>a.rs</td><td>100.00% (1/1)</td><td>25.00% (1/4)</td><td>- (0/0)</td></tr>
<tr><td>Totals</td><td>100.00% (1/1)</td><td>25.00% (1/4)</td><td>- (0/0)</td></tr>

parse_index_page_totals returns {'lines': (1, 1), 'branches': (1, 4)}. Expected: {'lines': (1, 4), 'branches': (0, 0)}.

Effect

With --yaml, a report without branch data is gated on the function coverage instead of the line coverage. In the example the effective line coverage is 100 % although 1 of 4 lines is covered. A Rust-only scope built without -Zcoverage-options=branch has no branch data.

Expected behavior

Read the totals from the Totals row by column, and accept - (0/0) as zero branches.

Linguagem predominante
Python
Estrelas
0
Forks
4
Merge médio
1d 16h
PRs com merge (30d)
16

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de eclipse-score/coverage_tool

Todas as issues de eclipse-score/coverage_tool

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.