fix(tia): keep a failure when the same test is also risky (#2014)

This commit is contained in:
Lazizbek Ergashev
2026-11-03 17:46:08 +05:00
committed by GitHub
parent 8eb2892f69
commit c6761c4bc1
2 changed files with 24 additions and 5 deletions
+1 -5
View File
@@ -100,11 +100,7 @@ final class ResultCollector
public function testRisky(string $message): void
{
if ($this->currentTestId === null) {
return;
}
$this->record(TestStatus::risky($message));
$this->recordIssue(TestStatus::risky($message));
}
/**
+23
View File
@@ -103,6 +103,29 @@ test('a failure outranks an issue triggered on the way to it', function (): void
->and($project->graph()['baselines']['master']['results'][$id]['status'])->toBe(7);
})->skipOnWindows();
test('a failure outranks the test also being risky', function (): void {
$project = Project::make('master');
$project->seed('master');
$project->write('tests/Unit/CalculatorTest.php', str_replace(
'toBe(3)',
'toBe(999)',
tiaTriggering('set_error_handler(fn (): bool => false);'),
));
$project->git()->commit('a failure in a risky test');
$result = $project->pest('--tia');
$id = Project::testId('tests/Unit/CalculatorTest.php', 'adds two numbers');
expect($result->exitCode)->not->toBe(0)
->and($project->graph()['baselines']['master']['results'][$id]['status'])->toBe(7);
$result = $project->pest('--tia');
expect($result->exitCode)->not->toBe(0, $result->describe());
})->skipOnWindows();
test('a skip outranks an issue triggered on the way to it', function (): void {
$project = Project::make('master');
$project->seed('master');