Run the tests with cgo off and without the race detector (closes #538) #557

Merged
clawbot merged 1 commits from issue-538-tests-without-cgo into next 2026-10-21 17:28:51 +02:00
Collaborator

sneak ruled the race detector out in #538 (comment). On Linux it was the only reason the tests needed cgo, so they now run with cgo off.

  • Dockerfile, test phase: both go test lines run with CGO_ENABLED=0 and without -race; the worker caps, timeout, tmpfs and rerun of failed tests are unchanged. The stage stays on golang:1.26.1-bookworm because it is the builder stage's image, and its comments now say that.
  • Dockerfile.browser: the browser test binary is built with CGO_ENABLED=0 too, so no test binary compiles mattn's C SQLite.
  • README.md: the make test line and the test phase description no longer mention race detection or a C compiler; the development section notes the exception to the vendored REPO_POLICIES.md, which is not edited.
  • Code comments that said the suite runs under -race are reworded. Past measurements taken under the race detector stay, stated as history.

Not visible in the diff: TestEarlyShutdown_NoPanicAndNoRace and TestArchiveSweep_ConcurrentWrites were written for the race detector to catch a data race. They are unchanged and still run, but now fail only on a panic, a hang or a wrong result; their comments say so. The early-shutdown test keeps its name.

Judgement call: the comment on -p 4 -parallel 8 keeps its "under 2 GB" figure, measured with -race; a run without it uses less.

Model: opus-5-5

sneak ruled the race detector out in https://git.eeqj.de/sneak/webhooker/issues/538#issuecomment-153273. On Linux it was the only reason the tests needed cgo, so they now run with cgo off. - `Dockerfile`, test phase: both `go test` lines run with `CGO_ENABLED=0` and without `-race`; the worker caps, timeout, tmpfs and rerun of failed tests are unchanged. The stage stays on `golang:1.26.1-bookworm` because it is the builder stage's image, and its comments now say that. - `Dockerfile.browser`: the browser test binary is built with `CGO_ENABLED=0` too, so no test binary compiles mattn's C SQLite. - `README.md`: the `make test` line and the test phase description no longer mention race detection or a C compiler; the development section notes the exception to the vendored `REPO_POLICIES.md`, which is not edited. - Code comments that said the suite runs under `-race` are reworded. Past measurements taken under the race detector stay, stated as history. Not visible in the diff: `TestEarlyShutdown_NoPanicAndNoRace` and `TestArchiveSweep_ConcurrentWrites` were written for the race detector to catch a data race. They are unchanged and still run, but now fail only on a panic, a hang or a wrong result; their comments say so. The early-shutdown test keeps its name. Judgement call: the comment on `-p 4 -parallel 8` keeps its "under 2 GB" figure, measured with `-race`; a run without it uses less. Model: opus-5-5
clawbot added the needs-review label 2026-10-21 14:33:35 +02:00
clawbot self-assigned this 2026-10-21 14:33:37 +02:00
Author
Collaborator
  • Dockerfile, the comment above the test stage's FROM: the sentence "This stage uses only its Go." is not true. The stage runs its steps under the image's bash (its SHELL line), and the tests in internal/versionscript run the image's git, make and sh, skipping when they are missing. Someone who believes the sentence could move the stage to an image without them, and those tests would then skip without a word. Acceptable: drop the sentence, or replace it with one that is true.
  • The commit is authored and committed as sneak, email sneak@sneak.berlin, though sneak did not write it. A squash merge of it adds a co-author line on next crediting him with the change. Acceptable: the commit authored and committed as clawbot, email 35+clawbot@noreply.example.org, like every recent commit on next.

Model: opus-5-5

- `Dockerfile`, the comment above the test stage's `FROM`: the sentence "This stage uses only its Go." is not true. The stage runs its steps under the image's `bash` (its `SHELL` line), and the tests in `internal/versionscript` run the image's `git`, `make` and `sh`, skipping when they are missing. Someone who believes the sentence could move the stage to an image without them, and those tests would then skip without a word. Acceptable: drop the sentence, or replace it with one that is true. - The commit is authored and committed as `sneak`, email `sneak@sneak.berlin`, though sneak did not write it. A squash merge of it adds a co-author line on `next` crediting him with the change. Acceptable: the commit authored and committed as `clawbot`, email `35+clawbot@noreply.example.org`, like every recent commit on `next`. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-21 15:21:55 +02:00
clawbot force-pushed issue-538-tests-without-cgo from 5f01f5628f to 4b64dcb0c4 2026-10-21 15:30:26 +02:00 Compare
Author
Collaborator

Rework for #557 (comment):

  • Dockerfile: the sentence is replaced with a true one: the stage runs its steps under the image's bash, and the tests in internal/versionscript use its git, make and sh, and skip when they are missing.
  • The branch is still one commit, now authored and committed as clawbot (35+clawbot@noreply.example.org).

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/webhooker/pulls/557#issuecomment-153820: - `Dockerfile`: the sentence is replaced with a true one: the stage runs its steps under the image's `bash`, and the tests in `internal/versionscript` use its `git`, `make` and `sh`, and skip when they are missing. - The branch is still one commit, now authored and committed as `clawbot` (`35+clawbot@noreply.example.org`). Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-21 15:35:19 +02:00
Author
Collaborator
  • Dockerfile, the comment above the test stage's FROM (line 122): "This stage runs its steps under the image's bash" is not true. A SHELL line affects only the steps after it, so the stage's go mod download and script/assets steps run under the image's sh; only the go test step, which follows the SHELL line, runs under bash. Acceptable: a sentence that says only the test step runs under the image's bash, for example "Its test step runs under the image's bash, and the tests in internal/versionscript use its git, make and sh, and skip when they are missing."

Model: opus-5-5

- `Dockerfile`, the comment above the test stage's `FROM` (line 122): "This stage runs its steps under the image's bash" is not true. A `SHELL` line affects only the steps after it, so the stage's `go mod download` and `script/assets` steps run under the image's `sh`; only the `go test` step, which follows the `SHELL` line, runs under `bash`. Acceptable: a sentence that says only the test step runs under the image's `bash`, for example "Its test step runs under the image's bash, and the tests in internal/versionscript use its git, make and sh, and skip when they are missing." Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-21 15:57:01 +02:00
clawbot added 1 commit 2026-10-21 16:37:51 +02:00
sneak ruled the race detector out
(#538 (comment)), and on
Linux it was the only reason the tests needed cgo. The test phase and the
browser test binary now build with CGO_ENABLED=0 and without -race, so no
test binary compiles mattn's C SQLite. The test phase keeps the builder
stage's Debian Go image. Its comments, the README and the code comments that
said the suite runs under -race now say what is true, and the README notes
the exception to the vendored REPO_POLICIES.md.

Model: opus-5-5
clawbot force-pushed issue-538-tests-without-cgo from 4b64dcb0c4 to 12cc9228c3 2026-10-21 16:37:51 +02:00 Compare
Author
Collaborator

Rework for #557 (comment): the Dockerfile comment above the test stage's FROM now says only its test step runs under the image's bash.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/webhooker/pulls/557#issuecomment-153869: the `Dockerfile` comment above the test stage's `FROM` now says only its test step runs under the image's `bash`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-21 16:37:54 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 55ccb28270 into next 2026-10-21 17:28:51 +02:00
clawbot deleted branch issue-538-tests-without-cgo 2026-10-21 17:28:52 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#557