Skip to content

Commit 0a226ad

Browse files
ci: fix Windows tests silently passing on failure (#2294)
PowerShell doesn't stop on non-zero exit codes by default. `go test` failures were ignored, and the step reported success because the subsequent caddy tests passed. Caught on this job, which fails but is green: https://github.com/php/frankenphp/actions/runs/23424633971/job/68136742625?pr=2287
1 parent 33fcc4d commit 0a226ad

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.github/workflows/windows.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ jobs:
229229
$env:PHPRC = Get-Location
230230
231231
go test -race ./...
232+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
232233
cd caddy
233234
go test -race ./...
235+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
234236
working-directory: ${{ github.workspace }}\frankenphp

frankenphp_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"os"
2424
"os/exec"
2525
"os/user"
26+
"runtime"
2627
"path/filepath"
2728
"strconv"
2829
"strings"
@@ -1315,6 +1316,10 @@ func testOpcachePreload(t *testing.T, opts *testOptions) {
13151316
t.Skip("This test is only supported in PHP 8.3 and above")
13161317
return
13171318
}
1319+
if runtime.GOOS == "windows" {
1320+
t.Skip("opcache.preload is not supported on Windows")
1321+
return
1322+
}
13181323

13191324
cwd, _ := os.Getwd()
13201325
preloadScript := cwd + "/testdata/preload.php"

0 commit comments

Comments
 (0)