Skip to content

fix(tia): re-anchor after a full suite run without a coverage driver - #1866

Open
lazerg wants to merge 1 commit into
pestphp:5.xfrom
lazerg:fix/issue-1864-tia-driverless-tree
Open

fix(tia): re-anchor after a full suite run without a coverage driver#1866
lazerg wants to merge 1 commit into
pestphp:5.xfrom
lazerg:fix/issue-1864-tia-driverless-tree

Conversation

@lazerg

@lazerg lazerg commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What:

  • Bug Fix
  • New Feature

Description:

ChangedFiles::filterUnchangedSinceLastRun() seeds its candidates with every path in lastRunTree, so a file that was edited during one run and reverted after it still counts as changed. It no longer matches the hash captured while it was dirty. That part is deliberate, a revert is a real change against the recorded edges.

What is missing is the clean up. Without pcov or xdebug, enterReplayMode() warns, runs the whole suite and returns before replayRan is set, so addOutput() never reaches bumpRecordedSha(). The entry outlives the run that was meant to cover it, and every run after that prints the same warning and runs the same full suite. A driver clears it, so the trap only closes on people who do not have one.

The fallback now flags the run, and the sha and the tree get re-anchored when it ends, the same way they do for a recorded commit that git no longer knows. The flag is read after the suppressed and RESULTS-ONLY checks, so a bailed or truncated run still writes nothing.

The regression test sits in tests/Features/Tia/StateReclamation.php, next to the equivalent one for the unreachable commit. It plants the stale tree entry, runs twice with XDEBUG_MODE=off, and expects the second run to replay instead of warning. It fails on 5.x in both the sequential and parallel datasets. The TIA tests are in their own group, so the snapshot tally does not move.

Related:

Fixes #1864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TIA: a reverted file stays in lastRunTree forever when no coverage driver is present, so every subsequent run runs the full suite

1 participant