mirror of
https://github.com/pestphp/pest.git
synced 2026-12-03 22:45:06 +01:00
fix(tia): keep the results of a parallel full-suite fallback (#2067)
This commit is contained in:
@@ -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.');
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user