mirror of
https://github.com/pestphp/pest.git
synced 2026-09-05 22:33:35 +02:00
more tests
This commit is contained in:
@@ -75,6 +75,40 @@ test('filtered mode finds nothing to do on a clean green feature branch', functi
|
||||
->and($delta->isHardSuppressed())->toBeTrue($delta->summary());
|
||||
})->skipOnWindows();
|
||||
|
||||
test('filtered mode falls back to a full replay when a cached failure cannot be located', function (): void {
|
||||
$project = Project::make('master');
|
||||
|
||||
$project->seed('master', failing: ['adds two numbers']);
|
||||
|
||||
$project->mutateGraph(function (array $graph): array {
|
||||
$testId = Project::testId('tests/Unit/CalculatorTest.php', 'adds two numbers');
|
||||
|
||||
$graph['baselines']['master']['results'][$testId]['file'] = 'tests/Unit/DeletedTest.php';
|
||||
|
||||
return $graph;
|
||||
});
|
||||
|
||||
$project->git()->switchTo('feature-x', new: true);
|
||||
|
||||
$result = $project->pest('--tia', '--filtered');
|
||||
|
||||
expect($result->output)->toContain('Some cached tests due a re-run could not be located on disk.')
|
||||
->and($result->output)->toContain('Running the full suite with replay instead of a filtered run.')
|
||||
->and($result->output)->not->toContain('No affected tests found');
|
||||
})->skipOnWindows();
|
||||
|
||||
test('filtered mode finds nothing to do on the default branch itself', function (): void {
|
||||
$project = Project::make('master');
|
||||
$project->seed('master');
|
||||
|
||||
$result = $project->pest('--tia', '--filtered');
|
||||
$delta = $project->delta();
|
||||
|
||||
expect($result->output)->toContain('No affected tests found')
|
||||
->and($result->exitCode)->toBe(0, $result->describe())
|
||||
->and($delta->isHardSuppressed())->toBeTrue($delta->summary());
|
||||
})->skipOnWindows();
|
||||
|
||||
test('a detached HEAD replays without minting a branch key', function (): void {
|
||||
$project = Project::make('master');
|
||||
$project->seed('master');
|
||||
|
||||
Reference in New Issue
Block a user