Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pytest-rerunfailures 16.6.1 duplicates JUnit records and inflates scores

Aperta
#64 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
testing

Direzione di ricerca

Parti da parse_test_results e riproduci il problema con pytest-rerunfailures==16.6.1, --reruns=2 e il test che fallisce sempre descritto qui. Verifica che i record JUnit duplicati siano raggruppati per test logico e valutati usando il tentativo finale, che le metriche di selezione dei tentativi ripetuti contino i test logici e che la versione installata del plugin di riesecuzione sia riproducibile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The evaluator installs pytest-rerunfailures without a version constraint. Version 16.6.1 changed its JUnit reporting behavior so that every rerun attempt produces a <testcase> record.

For a test that still fails after two reruns, the XML contains two empty records followed by one failure record for the same classname and name:

<testcase classname="test_rerun" name="test_always_fails" />
<testcase classname="test_rerun" name="test_always_fails" />
<testcase classname="test_rerun" name="test_always_fails">
  <failure message="assert False">AssertionError</failure>
</testcase>

parse_test_results currently processes each record independently and treats a record without a result child as passed. The single failing logical test is therefore scored as two passes and one failure, producing a score of 2/3 instead of 0/1.

Reproduction
  1. Install pytest-rerunfailures==16.6.1.
  2. Run an always-failing test with pytest --reruns=2 --junitxml=results.xml.
  3. Pass the resulting XML to parse_test_results.

With 16.6, the XML contains only the final failure record. With 16.6.1, it contains the three records shown above.

Expected behavior

Each logical test should contribute exactly once to the score, using the final attempt's status. Retry-selection metrics should also count logical tests rather than raw JUnit records. The installed rerun plugin version should be reproducible.

A fix is available in #63.

Lingua principale
Python
Stelle
938
Fork
68
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di facebookresearch/ProgramBench

Tutte le issue di facebookresearch/ProgramBench

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.