REPO_POLICIES.md requires the "conditional verbose rerun" pattern: run tests without-v first, and only if they fail, automatically rerun with -v to show full output. The stated purpose is that "this keeps CI logs and docker build output clean on success (just package/suite summaries) while providing full diagnostic detail on failure."
Current state (audited against origin/main, commit 9347a28)
script/test:8 runs, unconditionally:
go test -v -race -timeout 30s -cover ./...
-v is always on and there is no || fallback/rerun block anywhere in script/test or the Makefile. Makefile:22-23 is a correct thin shim (@script/test), so the fix belongs in script/test.
The -timeout 30s part is already correct and must be preserved.
The practical cost is real: a green make check on main currently prints a --- PASS: line for every individual test case plus every slog line the tests emit, burying the actual result. The canonical form in REPO_POLICIES.md is:
test:
@go test -timeout 30s -race -cover ./... ||\
{echo"--- Rerunning with -v for details ---";\
go test -timeout 30s -race -v ./...;exit 1;}
Definition of done
script/test runs go testwithout-v on the first attempt, keeping -race, -timeout 30s, and -cover.
On failure it prints a marker line and reruns the identical command with -v added.
After the rerun it exits non-zero unconditionally. REPO_POLICIES.md is explicit about why: "the first run already proved the tests are broken, so the build must not pass even if a flaky test happens to succeed on the second attempt. The rerun exists solely for diagnostic output." Do not let the rerun's exit status decide the outcome.
script/test remains POSIX sh — #!/bin/sh, set -eu, no bashisms — because it runs inside minimal alpine containers with no bash. Note that set -e interacts with || blocks; make sure the failure path is actually reached and the script does not abort before the rerun.
It still locates the repo root with the existing $(cd "$(dirname "$0")/.." && pwd -P) idiom and cds there before running.
Verify both paths by hand before opening the PR: make test on a green tree prints the concise summary and exits 0; make test with a deliberately broken test prints the rerun marker, shows verbose output, and exits non-zero. Revert the deliberate breakage before committing — do not commit it.
make check is green, and TODO.md is updated in the same commit as the work.
The finishing commit's title must end with (closes #N) referencing this issue.
Out of scope
Do not change the test timeout, do not add -short, and do not add any skip flags — TESTING.md forbids both -short and timeout inflation, and DNS mocking is banned repo-wide. This issue is purely about verbosity of output.
`REPO_POLICIES.md` requires the "conditional verbose rerun" pattern: run tests **without** `-v` first, and only if they fail, automatically rerun with `-v` to show full output. The stated purpose is that "this keeps CI logs and `docker build` output clean on success (just package/suite summaries) while providing full diagnostic detail on failure."
## Current state (audited against `origin/main`, commit `9347a28`)
`script/test:8` runs, unconditionally:
```sh
go test -v -race -timeout 30s -cover ./...
```
`-v` is always on and there is no `||` fallback/rerun block anywhere in `script/test` or the `Makefile`. `Makefile:22-23` is a correct thin shim (`@script/test`), so the fix belongs in `script/test`.
The `-timeout 30s` part is already correct and must be preserved.
The practical cost is real: a green `make check` on `main` currently prints a `--- PASS:` line for every individual test case plus every `slog` line the tests emit, burying the actual result. The canonical form in `REPO_POLICIES.md` is:
```makefile
test:
@go test -timeout 30s -race -cover ./... || \
{ echo "--- Rerunning with -v for details ---"; \
go test -timeout 30s -race -v ./...; exit 1; }
```
## Definition of done
1. `script/test` runs `go test` **without** `-v` on the first attempt, keeping `-race`, `-timeout 30s`, and `-cover`.
2. On failure it prints a marker line and reruns the identical command with `-v` added.
3. After the rerun it exits non-zero **unconditionally**. `REPO_POLICIES.md` is explicit about why: "the first run already proved the tests are broken, so the build must not pass even if a flaky test happens to succeed on the second attempt. The rerun exists solely for diagnostic output." Do not let the rerun's exit status decide the outcome.
4. `script/test` remains POSIX `sh` — `#!/bin/sh`, `set -eu`, no bashisms — because it runs inside minimal alpine containers with no bash. Note that `set -e` interacts with `||` blocks; make sure the failure path is actually reached and the script does not abort before the rerun.
5. It still locates the repo root with the existing `$(cd "$(dirname "$0")/.." && pwd -P)` idiom and `cd`s there before running.
6. Verify both paths by hand before opening the PR: `make test` on a green tree prints the concise summary and exits 0; `make test` with a deliberately broken test prints the rerun marker, shows verbose output, and exits non-zero. Revert the deliberate breakage before committing — do not commit it.
7. `make check` is green, and `TODO.md` is updated in the same commit as the work.
The finishing commit's title must end with ` (closes #N)` referencing this issue.
## Out of scope
Do not change the test timeout, do not add `-short`, and do not add any skip flags — `TESTING.md` forbids both `-short` and timeout inflation, and DNS mocking is banned repo-wide. This issue is purely about verbosity of output.
clawbot
added this to the 1.0 milestone 2026-08-09 03:37:37 +02:00
[manager] Satisfied on next by 6f6bf3a (#136), as a side effect of the test-cache work — script/test's primary run was unconditionally -v, so the pattern was absent rather than merely at risk.
All seven items of the definition of done verified by independent review, including the set -e/|| interaction this issue warned about. One deliberate deviation: -timeout 30s here is superseded by the 90s backstop landed in 9cb2c2b under the 60s/20s org ruling.
Left open rather than closed, since the fix is on next and not yet on main, and the commit subject closes only #139. Close this by hand when next merges. Do not re-implement it.
**[manager] Satisfied on `next` by `6f6bf3a`** (https://git.eeqj.de/sneak/dnswatcher/pulls/136), as a side effect of the test-cache work — `script/test`'s primary run was unconditionally `-v`, so the pattern was absent rather than merely at risk.
All seven items of the definition of done verified by independent review, including the `set -e`/`||` interaction this issue warned about. One deliberate deviation: `-timeout 30s` here is superseded by the `90s` backstop landed in `9cb2c2b` under the 60s/20s org ruling.
Left open rather than closed, since the fix is on `next` and not yet on `main`, and the commit subject closes only https://git.eeqj.de/sneak/dnswatcher/issues/139. Close this by hand when `next` merges. **Do not re-implement it.**
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
REPO_POLICIES.mdrequires the "conditional verbose rerun" pattern: run tests without-vfirst, and only if they fail, automatically rerun with-vto show full output. The stated purpose is that "this keeps CI logs anddocker buildoutput clean on success (just package/suite summaries) while providing full diagnostic detail on failure."Current state (audited against
origin/main, commit9347a28)script/test:8runs, unconditionally:-vis always on and there is no||fallback/rerun block anywhere inscript/testor theMakefile.Makefile:22-23is a correct thin shim (@script/test), so the fix belongs inscript/test.The
-timeout 30spart is already correct and must be preserved.The practical cost is real: a green
make checkonmaincurrently prints a--- PASS:line for every individual test case plus everyslogline the tests emit, burying the actual result. The canonical form inREPO_POLICIES.mdis:Definition of done
script/testrunsgo testwithout-von the first attempt, keeping-race,-timeout 30s, and-cover.-vadded.REPO_POLICIES.mdis explicit about why: "the first run already proved the tests are broken, so the build must not pass even if a flaky test happens to succeed on the second attempt. The rerun exists solely for diagnostic output." Do not let the rerun's exit status decide the outcome.script/testremains POSIXsh—#!/bin/sh,set -eu, no bashisms — because it runs inside minimal alpine containers with no bash. Note thatset -einteracts with||blocks; make sure the failure path is actually reached and the script does not abort before the rerun.$(cd "$(dirname "$0")/.." && pwd -P)idiom andcds there before running.make teston a green tree prints the concise summary and exits 0;make testwith a deliberately broken test prints the rerun marker, shows verbose output, and exits non-zero. Revert the deliberate breakage before committing — do not commit it.make checkis green, andTODO.mdis updated in the same commit as the work.The finishing commit's title must end with
(closes #N)referencing this issue.Out of scope
Do not change the test timeout, do not add
-short, and do not add any skip flags —TESTING.mdforbids both-shortand timeout inflation, and DNS mocking is banned repo-wide. This issue is purely about verbosity of output.[manager] Satisfied on
nextby6f6bf3a(#136), as a side effect of the test-cache work —script/test's primary run was unconditionally-v, so the pattern was absent rather than merely at risk.All seven items of the definition of done verified by independent review, including the
set -e/||interaction this issue warned about. One deliberate deviation:-timeout 30shere is superseded by the90sbackstop landed in9cb2c2bunder the 60s/20s org ruling.Left open rather than closed, since the fix is on
nextand not yet onmain, and the commit subject closes only #139. Close this by hand whennextmerges. Do not re-implement it.