Go tests run with -race and -cover under Go's own timeout; remaining handler and report-file tests #88

Closed
opened 2026-10-03 14:31:58 +02:00 by clawbot · 1 comment
Collaborator

The Go half of #21, split out so each half lands as one PR closing one issue; that issue keeps the frontend half. Plan: #21 (comment).

Definition of done

  • backend/script/test runs go test -timeout 30s -race -cover ./... and, if that fails, runs it again with -v and exits 1, as REPO_POLICIES.md shows. No shell timeout around it: Go's -timeout bounds the tests and not the compile.
  • The gate passes from a cold Go build cache with -race on, the root script/test included; if its shell timeout trips on compiling, each half is bounded by its own tool's timeout instead, said in the PR.
  • The builder stage of Dockerfile has what -race needs; the shipped binary stays a static CGO_ENABLED=0 build.
  • The TestImport stub in backend/internal/handlers/handlers_test.go is gone.
  • Tests, unless one already covers it: HandleHealthCheck returns the documented JSON with Content-Type: application/json; charset=utf-8; HandleReport answers a valid report with success; a written report file decompresses to exactly the lines appended; the flush when the buffer reaches its size threshold. testing and net/http/httptest only.
  • make test under 20 seconds; make check and script/cibuild pass; TODO.md updated in the same commit; commit title ends (closes #N).

Model: opus-5-5

The Go half of https://git.eeqj.de/sneak/netwatch/issues/21, split out so each half lands as one PR closing one issue; that issue keeps the frontend half. Plan: https://git.eeqj.de/sneak/netwatch/issues/21#issuecomment-116057. ## Definition of done - `backend/script/test` runs `go test -timeout 30s -race -cover ./...` and, if that fails, runs it again with `-v` and exits 1, as `REPO_POLICIES.md` shows. No shell `timeout` around it: Go's `-timeout` bounds the tests and not the compile. - The gate passes from a cold Go build cache with `-race` on, the root `script/test` included; if its shell timeout trips on compiling, each half is bounded by its own tool's timeout instead, said in the PR. - The builder stage of `Dockerfile` has what `-race` needs; the shipped binary stays a static `CGO_ENABLED=0` build. - The `TestImport` stub in `backend/internal/handlers/handlers_test.go` is gone. - Tests, unless one already covers it: `HandleHealthCheck` returns the documented JSON with `Content-Type: application/json; charset=utf-8`; `HandleReport` answers a valid report with success; a written report file decompresses to exactly the lines appended; the flush when the buffer reaches its size threshold. `testing` and `net/http/httptest` only. - `make test` under 20 seconds; `make check` and `script/cibuild` pass; `TODO.md` updated in the same commit; commit title ends ` (closes #N)`. Model: opus-5-5
clawbot self-assigned this 2026-10-03 14:31:58 +02:00
Author
Collaborator

Built in #89, against next. The backend tests now run with -race and -cover under Go's own -timeout, with the verbose rerun on failure. The builder stage has a C compiler for the race detector, and the four missing tests are added. The root script/test takes the fallback this issue allows: no single timeout around both halves, each half under its own.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/netwatch/pulls/89, against `next`. The backend tests now run with `-race` and `-cover` under Go's own `-timeout`, with the verbose rerun on failure. The builder stage has a C compiler for the race detector, and the four missing tests are added. The root `script/test` takes the fallback this issue allows: no single timeout around both halves, each half under its own. 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/netwatch#88