From 497f5bf6ec4692c8f5d8126b47e81a77e68dfdc0 Mon Sep 17 00:00:00 2001 From: sneak Date: Mon, 21 Sep 2026 07:38:22 +0000 Subject: [PATCH] fix: script/test conditional-verbose-rerun with -cover (closes #59) Run the suite without -v first so a passing build shows only per-package summaries; on failure rerun with -v for full diagnostics and exit non-zero, matching the conditional-verbose-rerun pattern in REPO_POLICIES.md. Add -cover to the first run per the policy's Go example; keep -race (added in #55) and the existing nix-shell CGO fallback for hosts without pkg-config/vips. model: claude-opus-4-8 --- script/test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/test b/script/test index 7192e5c..e9b4954 100755 --- a/script/test +++ b/script/test @@ -17,7 +17,11 @@ run_with_cgo_deps() { main() { cd "$ROOT" echo "Running tests..." - run_with_cgo_deps "CGO_ENABLED=1 go test -timeout 30s -race -v ./..." + # Run without -v first for clean output on success; on failure rerun + # with -v for full diagnostics, then exit non-zero (REPO_POLICIES.md + # conditional-verbose-rerun pattern). The first run already proved the + # tests broken, so the build fails even if the rerun happens to pass. + run_with_cgo_deps "CGO_ENABLED=1 go test -timeout 30s -race -cover ./... || { echo '--- Rerunning with -v for details ---'; CGO_ENABLED=1 go test -timeout 30s -race -v ./...; exit 1; }" } main "$@"