Skip to content

Commit 86562b2

Browse files
committed
Log test _before_ execution
1 parent c2140bc commit 86562b2

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

run-tests.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,14 @@ function run_all_tests(array $test_files, array $env, ?string $redir_tested = nu
12931293
ob_start();
12941294
}
12951295

1296+
if ($workerID) {
1297+
send_message($workerSock, [
1298+
"type" => "progress",
1299+
"name" => $name,
1300+
"index" => $index,
1301+
]);
1302+
}
1303+
12961304
$result = run_test($php, $name, $env);
12971305
if ($workerID) {
12981306
$resultText = ob_get_clean();
@@ -1589,6 +1597,13 @@ function run_all_tests_parallel(array $test_files, array $env, ?string $redir_te
15891597
goto escape;
15901598
}
15911599
break;
1600+
case "progress":
1601+
if ($show_progress) {
1602+
list($name, $index) = [$message["name"], $message["index"]];
1603+
$workerID = $message['workerID'];
1604+
show_test($test_idx, count($workerProcs) . "/$workers concurrent test workers running [$workerID, $name]");
1605+
}
1606+
break;
15921607
case "test_result":
15931608
list($name, $index, $result, $resultText) = [$message["name"], $message["index"], $message["result"], $message["text"]];
15941609
foreach ($message["PHP_FAILED_TESTS"] as $category => $tests) {
@@ -1602,11 +1617,6 @@ function run_all_tests_parallel(array $test_files, array $env, ?string $redir_te
16021617

16031618
echo $resultText;
16041619

1605-
if ($show_progress) {
1606-
$workerID = $message['workerID'];
1607-
show_test($test_idx, count($workerProcs) . "/$workers concurrent test workers running [$workerID, $name]");
1608-
}
1609-
16101620
if (!is_array($name) && $result != 'REDIR') {
16111621
$test_results[$index] = $result;
16121622

0 commit comments

Comments
 (0)