[Bug]: TIA replays a fetched baseline without the reachability check, so an unreachable SHA passes with no tests run

Aperta
#1,969 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 5 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, github-actions, php
Ambito
testing-qa

Direzione di ricerca

Start in src/Plugins/Tia.php: compare the local-graph reachability check near lines 858-865 with handleParent() and enterReplayMode(), where $changedFiles->since($branchSha) ?? [] around line 1053 treats null as no changes. Run vendor/bin/pest --tia with an unreachable baseline SHA to reproduce. Done when a fetched graph with an unreachable SHA is rebuilt or runs the full suite, and null from since() no longer means no changes.

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

Descrizione

bug
What Happened

When the TIA graph comes from a fetched baseline, handleParent() goes straight to replay mode without checking that the baseline's recorded commit is reachable.

  • A locally loaded graph is checked first: src/Plugins/Tia.php around lines 858–865 rebuilds it with "Recorded commit is no longer reachable — graph will be rebuilt."
  • A fetched graph never gets that check. enterReplayMode() then does $changed = $changedFiles->since($branchSha) ?? []; (line 1053), so an unreachable SHA reads as "nothing changed", and every test is replayed as passed.

Expected: a fetched graph gets the same reachability check as a local one, and is rebuilt (or the whole suite runs) when its SHA is unreachable. since() returning null should never mean "no changes".

How to Reproduce
  1. Fetch a baseline whose recorded SHA is not an ancestor of HEAD. Two ordinary ways to get there:
    • actions/checkout's default fetch-depth: 1, where no older commit exists locally;
    • with full history, a baseline recorded on a default-branch commit newer than the pull request's merge base.
  2. Put a parse error in an application class.
  3. Run vendor/bin/pest --tia.

Result: Tests: 2429 passed (8667 assertions, 2429 replayed), exit 0. With a reachable SHA and a valid edit to the same class, the same run selects 16 test files.

Sample Repository

No response

Pest Version

5.3.2 (PHPUnit 13.4.2, paratest 7.26.1)

PHP Version

8.5.8

Operation System

macOS

Notes

Related in spirit to #1856 (a result recorded for code that never ran), but the trigger here is a fetched baseline rather than a commit during the run.

Lingua principale
PHP
Stelle
11.8k
Fork
559
Merge medio
5g 23h
PR unite (30g)
24

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 pestphp/pest

Tutte le issue di pestphp/pest

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.