fix(tia): keep the results of a parallel full-suite fallback (#2067)

This commit is contained in:
Jhon Farias
2026-11-22 16:32:01 +01:00
committed by GitHub
parent a2d3e6badd
commit 5cb7a1c043
2 changed files with 24 additions and 0 deletions
+1
View File
@@ -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.');
+23
View File
@@ -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();