From 5cb7a1c0436d4ca81f724c7043e55ebfc4c381bd Mon Sep 17 00:00:00 2001 From: Jhon Farias Date: Sun, 22 Nov 2026 16:32:01 +0100 Subject: [PATCH] fix(tia): keep the results of a parallel full-suite fallback (#2067) --- src/Plugins/Tia.php | 1 + tests/Features/Tia/StateReclamation.php | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/Plugins/Tia.php b/src/Plugins/Tia.php index 8e343b5f..91ea258d 100644 --- a/src/Plugins/Tia.php +++ b/src/Plugins/Tia.php @@ -1117,6 +1117,7 @@ final class Tia implements AddsOutput, HandlesArguments, HandlesOriginalArgument if ($hasProjectPhpSourceChanges && ! $coverageAvailable) { $this->fullSuiteFallbackRan = true; + $this->requestWorkerResults(); $this->renderBadge('WARN', 'Detected PHP source changes but no coverage driver is available.'); $this->renderChild('Running the full suite to avoid using a stale dependency graph.'); diff --git a/tests/Features/Tia/StateReclamation.php b/tests/Features/Tia/StateReclamation.php index 8687438e..b4a62805 100644 --- a/tests/Features/Tia/StateReclamation.php +++ b/tests/Features/Tia/StateReclamation.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use PHPUnit\Framework\TestStatus\TestStatus; use Tests\Fixtures\Tia\Project; afterEach(function (): void { @@ -385,3 +386,25 @@ test('a full suite run without a coverage driver clears the tree it could not re ->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 records the results it ran', function (array $arguments): void { + $project = Project::make('master'); + $project->seed('master'); + + $id = Project::testId('tests/Unit/CalculatorTest.php', 'adds two numbers'); + + expect($project->graph()['baselines']['master']['results'][$id]['status'])->toBe(TestStatus::success()->asInt()); + + $project->write('app/Calculator.php', str_replace( + 'return $a + $b;', + 'return $a - $b;', + (string) file_get_contents($project->path().'/app/Calculator.php'), + )); + $project->git()->commit('break the adder'); + + $result = $project->pestWithEnvironment($project->path(), ['XDEBUG_MODE' => 'off'], '--tia', ...$arguments); + + expect($result->exitCode)->toBe(1, $result->describe()) + ->and($result->output)->toContain('no coverage driver is available') + ->and($project->graph()['baselines']['master']['results'][$id]['status'])->toBe(TestStatus::failure()->asInt()); +})->with(Project::SEQUENTIAL_AND_PARALLEL)->skipOnWindows();