mirror of
https://github.com/pestphp/pest.git
synced 2026-06-15 07:28:23 +02:00
consistent sharding logic when no shards file (#1710)
This commit is contained in:
@ -139,7 +139,8 @@ final class Shard implements AddsOutput, HandlesArguments, Terminable
|
|||||||
self::$timeBalanced = true;
|
self::$timeBalanced = true;
|
||||||
self::$shardsOutdated = $newTests !== [];
|
self::$shardsOutdated = $newTests !== [];
|
||||||
} else {
|
} else {
|
||||||
$testsToRun = (array_chunk($tests, max(1, (int) ceil(count($tests) / $total))))[$index - 1] ?? [];
|
$isInCurrentShard = fn (int $key) => $key % $total === ($index - 1);
|
||||||
|
$testsToRun = array_values(array_filter(array_values($tests), $isInCurrentShard, ARRAY_FILTER_USE_KEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$shard = [
|
self::$shard = [
|
||||||
|
|||||||
Reference in New Issue
Block a user