mirror of
https://github.com/pestphp/pest.git
synced 2026-06-07 11:52:13 +02:00
release: v4.7.0
This commit is contained in:
@ -1362,7 +1362,16 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable
|
||||
/** @var ResultCollector $collector */
|
||||
$collector = Container::getInstance()->get(ResultCollector::class);
|
||||
|
||||
foreach ($collector->all() as $testId => $result) {
|
||||
$results = $collector->all();
|
||||
$touchedFiles = [];
|
||||
|
||||
foreach ($results as $testId => $result) {
|
||||
$file = $result['file'] ?? null;
|
||||
|
||||
if (is_string($file) && $file !== '') {
|
||||
$touchedFiles[$file] = true;
|
||||
}
|
||||
|
||||
$graph->setResult(
|
||||
$this->branch,
|
||||
$testId,
|
||||
@ -1370,10 +1379,12 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable
|
||||
$result['message'],
|
||||
$result['time'],
|
||||
$result['assertions'],
|
||||
$result['file'] ?? null,
|
||||
$file,
|
||||
);
|
||||
}
|
||||
|
||||
$graph->pruneStaleResults($this->branch, array_keys($touchedFiles), array_keys($results));
|
||||
|
||||
$collector->reset();
|
||||
}
|
||||
|
||||
@ -1396,6 +1407,8 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable
|
||||
return;
|
||||
}
|
||||
|
||||
$touchedFiles = [];
|
||||
|
||||
foreach ($results as $testId => $result) {
|
||||
$file = $result['file'] ?? null;
|
||||
|
||||
@ -1403,6 +1416,10 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable
|
||||
$file = $this->resolveFailedTestFile($testId);
|
||||
}
|
||||
|
||||
if (is_string($file) && $file !== '') {
|
||||
$touchedFiles[$file] = true;
|
||||
}
|
||||
|
||||
$graph->setResult(
|
||||
$this->branch,
|
||||
$testId,
|
||||
@ -1414,6 +1431,8 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable
|
||||
);
|
||||
}
|
||||
|
||||
$graph->pruneStaleResults($this->branch, array_keys($touchedFiles), array_keys($results));
|
||||
|
||||
$this->saveGraph($graph);
|
||||
$collector->reset();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user