Run the tests under the race detector, in Docker (closes #23)
check / check (push) Successful in 20s
check / check (pull_request) Successful in 24s

script/test is now the standard script: it builds only the test stage
of the Dockerfile, without the build cache, so tests no longer run on
the host. That stage calls go test -race -cover directly, with a
verbose rerun on failure, on the Debian-based golang image, which has
the C toolchain -race needs.

The test stage no longer copies from the lint stage, so script/test
builds the tests alone. A new final stage copies one file from each of
the two stages; that is what makes a plain docker build, and so
script/cibuild, run both. The README entry for script/test and TODO.md
say what now runs.

Model: opus-5-5
This commit is contained in:
2026-10-06 10:58:00 +00:00
parent 8e53530434
commit 3bf2079492
4 changed files with 29 additions and 9 deletions
+3 -1
View File
@@ -145,7 +145,9 @@ alpine. We provide:
`script/bootstrap`, then `script/install-precommit`
- `script/projectname` — output the project name (our own extension); used by
`script/docker` for the image tag
- `script/test` — run the test suite (`go test -v ./...`)
- `script/test` — run the test suite under the race detector in Docker by
building only the `test` stage of the `Dockerfile`, without the build cache,
so every run tests; the image is tagged `simplelog-test`
- `script/lint` — run golangci-lint in Docker by building only the `lint`
stage of the `Dockerfile` (which also runs the format check), without the
build cache, so every run lints; the image is tagged `simplelog-lint`