mirror of
https://github.com/pestphp/pest.git
synced 2026-06-05 02:52:12 +02:00
wip
This commit is contained in:
@ -516,13 +516,13 @@ final class Graph
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public function failedOrErroredTestFiles(string $branch, string $fallbackBranch = 'main'): array
|
||||
public function testFilesToRerun(string $branch, string $fallbackBranch = 'main'): array
|
||||
{
|
||||
$baseline = $this->baselineFor($branch, $fallbackBranch);
|
||||
$files = [];
|
||||
|
||||
foreach ($baseline['results'] as $result) {
|
||||
if ($result['status'] !== 7 && $result['status'] !== 8) {
|
||||
if (! self::shouldRerun($result['status'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -544,12 +544,12 @@ final class Graph
|
||||
return array_keys($files);
|
||||
}
|
||||
|
||||
public function hasUnlocatedFailuresOrErrors(string $branch, string $fallbackBranch = 'main'): bool
|
||||
public function hasUnlocatedTestsToRerun(string $branch, string $fallbackBranch = 'main'): bool
|
||||
{
|
||||
$baseline = $this->baselineFor($branch, $fallbackBranch);
|
||||
|
||||
foreach ($baseline['results'] as $result) {
|
||||
if ($result['status'] !== 7 && $result['status'] !== 8) {
|
||||
if (! self::shouldRerun($result['status'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -563,6 +563,16 @@ final class Graph
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function shouldRerun(int $status): bool
|
||||
{
|
||||
$testStatus = TestStatus::from($status);
|
||||
|
||||
return $testStatus->isFailure()
|
||||
|| $testStatus->isError()
|
||||
|| $testStatus->isIncomplete()
|
||||
|| $testStatus->isRisky();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $tree project-relative path → content hash
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user