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

Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
This commit is contained in:
Lazizbek Ergashev
2026-08-25 23:15:02 +05:00
committed by GitHub
parent eac05bcee9
commit 20a5aacaca
2 changed files with 32 additions and 1 deletions
+27
View File
@@ -358,3 +358,30 @@ test('a graph whose recorded commit is gone is re-anchored, not warned about for
->and($second->replayed())->toBe(Project::TOTAL_TESTS, $second->describe())
->and($delta->writtenCount())->toBe(0, $delta->summary());
})->with(Project::SEQUENTIAL_AND_PARALLEL)->skipOnWindows();
test('a full suite run without a coverage driver clears the tree it could not refresh', function (array $arguments): void {
$project = Project::make('master');
$project->seed('master');
$project->mutateGraph(function (array $graph): array {
$graph['baselines']['master']['tree'] = ['app/Calculator.php' => 'deadbeefdeadbeefdeadbeefdeadbeef'];
return $graph;
});
$environment = ['XDEBUG_MODE' => 'off'];
$first = $project->pestWithEnvironment($project->path(), $environment, '--tia', ...$arguments);
expect($first->exitCode)->toBe(0, $first->describe())
->and($first->output)->toContain('no coverage driver is available')
->and($first->tally())->toContain(Project::TOTAL_TESTS.' passed');
$project->snapshot();
$second = $project->pestWithEnvironment($project->path(), $environment, '--tia', ...$arguments);
$delta = $project->delta();
expect($second->output)->not->toContain('no coverage driver is available')
->and($second->replayed())->toBe(Project::TOTAL_TESTS, $second->describe())
->and($delta->writtenCount())->toBe(0, $delta->summary());
})->with(Project::SEQUENTIAL_AND_PARALLEL)->skipOnWindows();