Go tests run with -race and -cover under Go's own timeout (closes #88)
check / check (push) Successful in 2m18s

backend/script/test runs go test -timeout 30s -race -cover and, if
that fails, runs it again with -v and fails. The root script/test drops
its one 30-second timeout around both halves: from a cold Go build
cache, compiling the tests with -race used it all up on four cores.
Each half keeps its own limit. The builder stage of the Dockerfile
gains gcc and musl-dev for the race detector; make build still sets
CGO_ENABLED=0. New tests: the health check's answer, a valid report's
answer, a report file's exact lines, and the flush at the 10 MiB
threshold. The handlers TestImport stub is gone.

Model: opus-5-5
This commit is contained in:
2026-10-03 13:04:34 +00:00
parent 4ce0814b14
commit 57b29df445
11 changed files with 312 additions and 32 deletions
+10
View File
@@ -23,6 +23,16 @@ latest run passes.
# Completed Steps
- 2026-10-03: the Go tests run with the race detector and coverage (issue #88):
`backend/script/test` runs `go test -timeout 30s -race -cover ./...` and, if
that fails, runs it again with `-v` and fails. Go's `-timeout` bounds the
tests, not their compile; the root `script/test` no longer puts one 30-second
timeout around both halves, which a cold Go build cache could use up on
compiling alone. The builder stage of `Dockerfile` has gcc and musl-dev for
the race detector; the binary is still built with `CGO_ENABLED=0`. New tests
cover the health check's answer, a valid report's answer, a report file's
exact contents, and the flush when the buffer reaches 10 MiB; the handlers'
`TestImport` stub is gone
- 2026-09-29: the container sets up its own data directory (issue #75):
`bin/entrypoint.sh`, still as root, creates `DATA_DIR` if missing and gives it
and `/data` to the `netwatch` user with mode 750 before starting the backend