script/test always runs verbose and never measures coverage, against the policy pattern #315

Closed
opened 2026-09-21 09:20:20 +02:00 by clawbot · 2 comments
Collaborator

script/test runs go test -v -race -timeout 90s ./... unconditionally. REPO_POLICIES.md requires the conditional verbose rerun: a quiet first run with -cover, and a -v rerun only on failure, exiting non-zero regardless. Every green CI build and every local make check currently prints every test name, which buries the one line that matters when something is red.

Definition of done

  • script/test runs quietly with -race -cover -timeout 90s first and reruns with -v only when that fails, then exits 1.
  • The header comment in script/test about the 90s timeout survives as it stands.
  • Verified by running the script once green and once with a deliberately failing test, and confirming the second exits non-zero.

Model: fable-5-1

`script/test` runs `go test -v -race -timeout 90s ./...` unconditionally. `REPO_POLICIES.md` requires the conditional verbose rerun: a quiet first run with `-cover`, and a `-v` rerun only on failure, exiting non-zero regardless. Every green CI build and every local `make check` currently prints every test name, which buries the one line that matters when something is red. ## Definition of done - `script/test` runs quietly with `-race -cover -timeout 90s` first and reruns with `-v` only when that fails, then exits 1. - The header comment in `script/test` about the 90s timeout survives as it stands. - Verified by running the script once green and once with a deliberately failing test, and confirming the second exits non-zero. Model: fable-5-1
clawbot added this to the 1.0.0 milestone 2026-09-21 09:20:20 +02:00
Author
Collaborator

Plan. Since #414, script/test runs without -v, because the Docker build cuts its log at 2 MiB and the suite's verbose output passed that before any failure printed. A verbose rerun of every package would bring that back. So: the first run is quiet, with -race -cover; on failure, the script reruns with -v only the tests that failed (their names taken from the first run's --- FAIL lines, in their packages), then exits non-zero. A green run stays quiet; a red run ends with the failing tests' verbose output, which the log can hold. The header comment about the 90-second timeout stays as it is. Verified once green and once with a deliberately failing test (removed again), with a short note in the PR on the log size of the red case.

Model: opus-5-5

Plan. Since https://git.eeqj.de/sneak/webhooker/issues/414, `script/test` runs without `-v`, because the Docker build cuts its log at 2 MiB and the suite's verbose output passed that before any failure printed. A verbose rerun of every package would bring that back. So: the first run is quiet, with `-race -cover`; on failure, the script reruns with `-v` only the tests that failed (their names taken from the first run's `--- FAIL` lines, in their packages), then exits non-zero. A green run stays quiet; a red run ends with the failing tests' verbose output, which the log can hold. The header comment about the 90-second timeout stays as it is. Verified once green and once with a deliberately failing test (removed again), with a short note in the PR on the log size of the red case. Model: opus-5-5
Author
Collaborator

Built in #425. script/test now runs the suite once with -race -cover and no -v. On a failure it reruns only the failed top-level tests, with -v, in the packages that failed, and then exits 1 whatever the rerun shows. A failure that names no test (a build error, a timeout) skips the rerun, since the quiet run already prints that package's full output. The timeout, -p 4 -parallel 8 and their header comment are unchanged.

  • Unverified: the 90-second timeout figures in the header were measured without -cover; I did not re-measure them with it.
  • Partially verified: the rerun on failure was exercised on the host, not inside a Docker build.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/webhooker/pulls/425. `script/test` now runs the suite once with `-race -cover` and no `-v`. On a failure it reruns only the failed top-level tests, with `-v`, in the packages that failed, and then exits 1 whatever the rerun shows. A failure that names no test (a build error, a timeout) skips the rerun, since the quiet run already prints that package's full output. The timeout, `-p 4 -parallel 8` and their header comment are unchanged. - Unverified: the 90-second timeout figures in the header were measured without `-cover`; I did not re-measure them with it. - Partially verified: the rerun on failure was exercised on the host, not inside a Docker build. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#315