Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c81d381135 |
No files matched your search
@@ -28,8 +28,9 @@ fmt-check, and commit.
|
|||||||
`panic: test timed out` or `*** Test killed`, and exits 1 when either is
|
`panic: test timed out` or `*** Test killed`, and exits 1 when either is
|
||||||
there. The Python `make test` example takes the same `timeout 90 sh -c`
|
there. The Python `make test` example takes the same `timeout 90 sh -c`
|
||||||
wrapper as its `Dockerfile` example. The 60 and 90 second rule and the
|
wrapper as its `Dockerfile` example. The 60 and 90 second rule and the
|
||||||
5-minute rule now say a hung package uses the backstop once. Consuming
|
5-minute rule now say a hung package uses the backstop once. The Go item in
|
||||||
repositories pick this up on their next re-vendor.
|
both repo checklists now asks for this, so a repository with the old recipe
|
||||||
|
fails it.
|
||||||
- 2026-10-27: Added `prompts/API_POLICIES.md`
|
- 2026-10-27: Added `prompts/API_POLICIES.md`
|
||||||
(https://git.eeqj.de/sneak/prompts/issues/137). It holds sneak's rule from
|
(https://git.eeqj.de/sneak/prompts/issues/137). It holds sneak's rule from
|
||||||
https://git.eeqj.de/sneak/routewatch/issues/199 that a value in an API
|
https://git.eeqj.de/sneak/routewatch/issues/199 that a value in an API
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: Existing Repo Checklist
|
title: Existing Repo Checklist
|
||||||
last_modified: 2026-10-26
|
last_modified: 2026-11-03
|
||||||
---
|
---
|
||||||
|
|
||||||
Use this checklist when beginning work in a repo that may not yet conform to our
|
Use this checklist when beginning work in a repo that may not yet conform to our
|
||||||
@@ -70,8 +70,9 @@ with your task.
|
|||||||
(`--mount=type=cache,target=/root/.cache/go-build`), `golangci-lint run`
|
(`--mount=type=cache,target=/root/.cache/go-build`), `golangci-lint run`
|
||||||
also mounts golangci-lint's
|
also mounts golangci-lint's
|
||||||
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
||||||
mounts anything else; both `go test` runs carry `-count=1`, as in the
|
mounts anything else; both `go test` runs carry `-count=1`; a first run
|
||||||
canonical Go `Dockerfile` in `REPO_POLICIES.md`
|
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
|
||||||
|
`REPO_POLICIES.md`
|
||||||
- [ ] Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
- [ ] Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
||||||
it above `ARG CACHEBUST`, with `COPY script/ script/`,
|
it above `ARG CACHEBUST`, with `COPY script/ script/`,
|
||||||
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: New Repo Checklist
|
title: New Repo Checklist
|
||||||
last_modified: 2026-10-26
|
last_modified: 2026-11-03
|
||||||
---
|
---
|
||||||
|
|
||||||
Use this checklist when creating a new repository from scratch. Follow the steps
|
Use this checklist when creating a new repository from scratch. Follow the steps
|
||||||
@@ -129,8 +129,9 @@ Template files can be fetched from:
|
|||||||
(`--mount=type=cache,target=/root/.cache/go-build`), `golangci-lint run`
|
(`--mount=type=cache,target=/root/.cache/go-build`), `golangci-lint run`
|
||||||
also mounts golangci-lint's
|
also mounts golangci-lint's
|
||||||
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
|
||||||
mounts anything else; both `go test` runs carry `-count=1`, as in the
|
mounts anything else; both `go test` runs carry `-count=1`; a first run
|
||||||
canonical Go `Dockerfile` in `REPO_POLICIES.md`
|
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
|
||||||
|
`REPO_POLICIES.md`
|
||||||
- Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
- Python: a `test` phase that installs its packages from `Pipfile.lock` does
|
||||||
it above `ARG CACHEBUST`, with `COPY script/ script/`,
|
it above `ARG CACHEBUST`, with `COPY script/ script/`,
|
||||||
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
|
||||||
|
|||||||
+13
-10
@@ -233,7 +233,8 @@ style conventions are in separate documents:
|
|||||||
# Test phase. -race needs cgo and so a C compiler, which the Debian Go
|
# Test phase. -race needs cgo and so a C compiler, which the Debian Go
|
||||||
# image ships and the alpine one does not. -count=1 because the mounted
|
# image ships and the alpine one does not. -count=1 because the mounted
|
||||||
# cache also holds test results, which go test would otherwise replay.
|
# cache also holds test results, which go test would otherwise replay.
|
||||||
# A first run that timed out gets no rerun: its output has the stacks.
|
# A first run that timed out gets no rerun, because a rerun would only
|
||||||
|
# wait for the same hang.
|
||||||
# golang:1.x, YYYY-MM-DD
|
# golang:1.x, YYYY-MM-DD
|
||||||
FROM golang@sha256:... AS test
|
FROM golang@sha256:... AS test
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@@ -242,8 +243,8 @@ style conventions are in separate documents:
|
|||||||
ARG CACHEBUST
|
ARG CACHEBUST
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
output=$(go test -count=1 -timeout 90s -race -cover ./... 2>&1); \
|
status=0; \
|
||||||
status=$?; \
|
output=$(go test -count=1 -timeout 90s -race -cover ./... 2>&1) || status=$?; \
|
||||||
printf '%s\n' "$output"; \
|
printf '%s\n' "$output"; \
|
||||||
test "$status" -eq 0 && exit 0; \
|
test "$status" -eq 0 && exit 0; \
|
||||||
case "$output" in \
|
case "$output" in \
|
||||||
@@ -510,8 +511,7 @@ style conventions are in separate documents:
|
|||||||
```makefile
|
```makefile
|
||||||
test:
|
test:
|
||||||
@<test-command> || \
|
@<test-command> || \
|
||||||
{ <exit 1 if that run timed out>; \
|
{ echo "--- Rerunning with -v for details ---"; \
|
||||||
echo "--- Rerunning with -v for details ---"; \
|
|
||||||
<test-command-with-v>; exit 1; }
|
<test-command-with-v>; exit 1; }
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -519,8 +519,8 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
test:
|
test:
|
||||||
@output=$$(go test -count=1 -timeout 90s -race -cover ./... 2>&1); \
|
@status=0; \
|
||||||
status=$$?; \
|
output=$$(go test -count=1 -timeout 90s -race -cover ./... 2>&1) || status=$$?; \
|
||||||
printf '%s\n' "$$output"; \
|
printf '%s\n' "$$output"; \
|
||||||
test "$$status" -eq 0 && exit 0; \
|
test "$$status" -eq 0 && exit 0; \
|
||||||
case "$$output" in \
|
case "$$output" in \
|
||||||
@@ -539,8 +539,8 @@ style conventions are in separate documents:
|
|||||||
|
|
||||||
Go prints the goroutine stacks with either line, as long as the test can
|
Go prints the goroutine stacks with either line, as long as the test can
|
||||||
still respond. A rerun would only wait for the same hang, so the recipe
|
still respond. A rerun would only wait for the same hang, so the recipe
|
||||||
exits 1. Any other failure reruns with `-v`. The kept output prints when the
|
exits 1. A failure with neither line in its output reruns with `-v`. The
|
||||||
first run ends, not while it runs.
|
kept output prints when the first run ends, not while it runs.
|
||||||
|
|
||||||
`-count=1` is required on both invocations: it defeats Go's test _result_
|
`-count=1` is required on both invocations: it defeats Go's test _result_
|
||||||
cache, so neither run can report a stored pass in place of running the
|
cache, so neither run can report a stored pass in place of running the
|
||||||
@@ -566,7 +566,10 @@ style conventions are in separate documents:
|
|||||||
```
|
```
|
||||||
|
|
||||||
Both pytest runs share that one 90-second timeout, as in the `Dockerfile`
|
Both pytest runs share that one 90-second timeout, as in the `Dockerfile`
|
||||||
example above, so a hang uses it once and gets no rerun.
|
example above, so a hang uses it once and gets no rerun. Ctrl-C does not
|
||||||
|
stop a running `make test`, which goes on until the tests end or the 90
|
||||||
|
seconds run out. On a Mac without `timeout`, the target fails until it is
|
||||||
|
installed.
|
||||||
|
|
||||||
The `exit 1` ensures the target always fails after a rerun — the first run
|
The `exit 1` ensures the target always fails after a rerun — the first run
|
||||||
already proved the tests are broken, so the build must not pass even if a
|
already proved the tests are broken, so the build must not pass even if a
|
||||||
|
|||||||
Reference in new issue
Block a user