Skip to content

Commit 43c1dcf

Browse files
committed
Parallel level tests - make bigger chunks
1 parent 938321c commit 43c1dcf

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/tests-levels-matrix.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,12 @@
2929
throw new RuntimeException('No tests found');
3030
}
3131

32-
echo json_encode($testFilters);
32+
$chunkSize = (int) ceil(count($testFilters) / 10);
33+
$chunks = array_chunk($testFilters, $chunkSize);
34+
35+
$commands = [];
36+
foreach ($chunks as $chunk) {
37+
$commands[] = implode("\n", array_map(fn (string $ch) => sprintf('php vendor/bin/phpunit %s --group levels', $ch), $chunk));
38+
}
39+
40+
echo json_encode($commands);

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135

136136
strategy:
137137
matrix:
138-
test-filter: "${{fromJson(needs.tests-levels-matrix.outputs.matrix)}}"
138+
script: "${{fromJson(needs.tests-levels-matrix.outputs.matrix)}}"
139139

140140
steps:
141141
- name: "Checkout"
@@ -155,7 +155,7 @@ jobs:
155155
run: "composer install --no-interaction --no-progress"
156156

157157
- name: "Tests"
158-
run: "php vendor/bin/phpunit ${{ matrix.test-filter }} --group levels"
158+
run: "${{ matrix.script }}"
159159

160160
tests-old-phpunit:
161161
name: "Tests with old PHPUnit"

0 commit comments

Comments
 (0)