Skip to content

Pass -count=1 to every e2e make target - #833

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/831-e2e-count1
Oct 11, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/831-e2e-count1

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Closes #831.

The hole

The e2e harness builds bin/spawn and execs it at runtime. Go's test cache keys on
source, build flags and environment — it cannot see a binary read at runtime — so a
second invocation reports ok (cached) whatever bin/spawn now is.

Demonstrated rather than inferred:

$ go test -tags=e2e_tier0 -timeout 30m ./test/e2e/
ok  	github.com/spore-host/spawn/test/e2e	68.351s

$ go test -tags=e2e_tier0 -timeout 30m ./test/e2e/
ok  	github.com/spore-host/spawn/test/e2e	(cached)

$ printf '#!/bin/sh\nexit 1\n' > bin/spawn && chmod +x bin/spawn
$ go test -tags=e2e_tier0 -timeout 30m ./test/e2e/
ok  	github.com/spore-host/spawn/test/e2e	(cached)

The third run is the point: the entire Tier 0 surface reports green against a spawn
that does nothing but exit 1.

This was #792, fixed where it was noticed and left in the Makefile — which is where most
people invoke it from. grep -c count=1 Makefile was 1, and that one was elsewhere.

Tiers 2 and 3 are the expensive version, not just the embarrassing one. They launch real
billable instances, so a cached pass lets a release be cut on a run that never touched
AWS, and nothing in the (cached) line says which happened.

After

$ make test-e2e-tier0
ok  	github.com/spore-host/spawn/test/e2e	67.876s
$ make test-e2e-tier0
ok  	github.com/spore-host/spawn/test/e2e	68.659s

The second run executes instead of reporting (cached).

Gate

TestEveryE2EMakeRecipePassesCountOne scans the Makefile for every recipe line running
go test against ./test/e2e/ and requires -count=1. Discovery rather than a list of
target names (rule 4), so a future Tier 4 inherits the requirement instead of silently
escaping it; it fails on empty discovery, and carries a floor of four recipes so a regex
that stops matching cannot pass as a clean Makefile.

Three compiling reverts, each failing with its own message:

revert failure
drop -count=1 from tier 0 Makefile:161 runs the e2e suite without -count=1 …
rename ./test/e2e/ → ./test/endtoend/ found no Makefile recipe … discovery has broken
replace two tier recipes with @echo found only 2 e2e recipes; the repo has four tiers

Verification

make check, make check-docs, changelog gate, and Tier 0 run twice to confirm the
second is not cached.

@scttfrdmn scttfrdmn added this to the Correctness audit 2026-10 milestone Oct 11, 2026
@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The e2e harness builds bin/spawn and execs it at runtime. Go's test
cache keys on source, build flags and environment — it cannot see a
binary read at runtime — so a second invocation reported `ok (cached)`
regardless of what bin/spawn had become. Replacing bin/spawn with a
shell script whose entire body is `exit 1` still passed the whole Tier 0
surface.

This was #792, fixed where it was noticed and left in the Makefile,
which is where most people invoke it from.

Tiers 2 and 3 are the costly version of the same hole rather than the
embarrassing one: they launch real billable instances, so a cached pass
let a release be cut on a run that never touched AWS, with output
indistinguishable from one that did.

TestEveryE2EMakeRecipePassesCountOne discovers the recipes instead of
naming the targets, so a future tier inherits the requirement, and fails
when discovery finds nothing rather than reporting the Makefile clean.

Closes #831
@scttfrdmn
scttfrdmn merged commit 96ad52c into main Oct 11, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/831-e2e-count1 branch October 11, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

All four e2e make targets omit -count=1, so a cached pass can certify a binary that does nothing

1 participant