ci: keep go test's status when it fails under -e (#8372)
release / web (push) Successful in 1m33s
release / go (push) Failing after 2m0s
release / govulncheck (push) Successful in 19s
release / integration (push) Failing after 2m45s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Publish the release image to GHCR (dispatch only) (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / android (push) Canceled after 2m34s
release / Build signed APK (push) Canceled after 1m58s

Break run 11328 went red for the wrong reason. The step shell runs with
-e, so a failing go test ended the brace group before `echo $?` wrote
its status; the step then died on `exit ""` ("numeric argument
required"). `|| rc=$?` keeps the group alive to record the status, and a
missing status file now exits 1 rather than relying on that error.

Breaks from 8af3c41b are still in place, so this run must be red with
go test's own exit code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 22:07:27 -05:00
co-authored by Claude Opus 5.5
parent 8af3c41b6e
commit f5ad422c17
2 changed files with 11 additions and 8 deletions
+2 -2
View File
@@ -6,8 +6,8 @@
// It never decides whether the run passed. The lane exits with go test's own
// status, which is why the pipe keeps it aside:
//
// { go test -json ./...; echo $? > /tmp/go-test-rc; } | testcount
// exit "$(cat /tmp/go-test-rc)"
// { rc=0; go test -json ./... || rc=$?; echo "$rc" > /tmp/go-test-rc; } | testcount
// exit "$(cat /tmp/go-test-rc 2>/dev/null || echo 1)"
package main
import (