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

Abierto Apto para principiantes
#95 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, rust
Área
testing-qa

Línea de trabajo

Empieza con effective_coverage.parse_index_page_totals y reproduce el problema usando las filas sintéticas de html_report/index.html del issue. Comprueba cómo selecciona los totales y trata la celda de branches - (0/0). Se considera terminado cuando devuelve líneas (1, 4) y branches (0, 0) para la reproducción, de modo que la cobertura efectiva de líneas use los totales de líneas.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
0
Forks
4
Merge medio
1 d 16 h
PR fusionados (30 d)
16

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eclipse-score/coverage_tool

Todos los issues de eclipse-score/coverage_tool

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.