mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-06-10 16:47:14 +00:00
Detect failing tests in parallel shard runner
The previous logic considered a shard "passed" if its log contained any [ PASSED ] line, missing the case where some tests pass and some fail (both [ PASSED ] N tests. and [ FAILED ] M tests, listed below: appear in the gtest summary). Exit codes from the test binaries were also ignored. Now require both: an [ PASSED ] line, no [ FAILED ] line, and a zero exit code. Track each shard's PID so wait can surface non-zero exits. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
7
.github/workflows/test.yaml
vendored
7
.github/workflows/test.yaml
vendored
@@ -322,11 +322,14 @@ jobs:
|
||||
$failed = $false
|
||||
for ($i = 0; $i -lt $shards; $i++) {
|
||||
$log = "shard_${i}.log"
|
||||
if (Select-String -Path $log -Pattern "\[ PASSED \]" -Quiet) {
|
||||
$proc = $procs[$i]
|
||||
$hasPassed = Select-String -Path $log -Pattern "\[ PASSED \]" -Quiet
|
||||
$hasFailed = Select-String -Path $log -Pattern "\[ FAILED \]" -Quiet
|
||||
if ($hasPassed -and -not $hasFailed -and $proc.ExitCode -eq 0) {
|
||||
$passed = (Select-String -Path $log -Pattern "\[ PASSED \]").Line
|
||||
Write-Host "Shard ${i}: $passed"
|
||||
} else {
|
||||
Write-Host "=== Shard $i FAILED ==="
|
||||
Write-Host "=== Shard $i FAILED (exit=$($proc.ExitCode)) ==="
|
||||
Get-Content $log
|
||||
if (Test-Path "${log}.err") { Get-Content "${log}.err" }
|
||||
$failed = $true
|
||||
|
||||
Reference in New Issue
Block a user