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 "$@"