Skip to content

test: give the hardening grab-bags subject-named homes - #50

Merged
blakebauman merged 1 commit into
mainfrom
test/redistribute-hardening-tests
Aug 13, 2026
Merged

blakebauman merged 1 commit into
mainfrom
test/redistribute-hardening-tests

Conversation

@blakebauman

Copy link
Copy Markdown
Member

hardening_test.go and hardening3_test.go were named after the PRs that produced them, not what they cover — and the 3 had no 2, so the numbering told the reader nothing. Every other test file in the package is named for its subject (bodycap, listmemo, tenant_visibility), which is what makes a failing test name locatable.

The 13 tests move to the files that already own their subject:

Destination Tests
security_test.go host/origin validation tables, malformed-port rebinding, -32041 redaction
health_test.go (new) fan-out single-flight, cache invalidation across reload, /healthz removal record
discovery_test.go redirect refusal, poll-interval clamp
ema_test.go token-exchange audit
loadbalance_test.go bounded failover walk
ssehang_test.go idle-timeout body
listen_test.go orphaned subscription reaped

readAuditEvents moves to gateway_test.go alongside the other shared fixtures — bodycap_test.go already depended on it across files, so it was never hardening3's to hold. getString goes to health_test.go, its only caller.

Test bodies are unchanged; this is a move, not a rewrite. No production code is touched.

Verification

  • go test ./... -race — all 14 packages pass
  • go vet ./gateway, gofmt -l ., go mod tidy -diff — clean
  • make lint not run locally (golangci-lint not installed on this machine); CI covers it

🤖 Generated with Claude Code

hardening_test.go and hardening3_test.go were named after the PRs that
produced them, not what they cover — and the 3 had no 2, so the numbering
told the reader nothing. Every other test file in the package is named for
its subject (bodycap, listmemo, tenant_visibility), which is what makes a
failing test name locatable.

The 13 tests move to the files that already own their subject:

  security_test.go     host/origin validation tables, the malformed-port
                       rebinding case, and -32041 redaction
  health_test.go (new) fan-out single-flight, cache invalidation across
                       reload, and the /healthz removal record
  discovery_test.go    redirect refusal and poll-interval clamp
  ema_test.go          token-exchange audit
  loadbalance_test.go  bounded failover walk
  ssehang_test.go      idle-timeout body
  listen_test.go       orphaned subscription reaped

readAuditEvents moves to gateway_test.go alongside the other shared
fixtures — bodycap_test.go already depended on it across files, so it was
never hardening3's to hold. getString goes to health_test.go, its only
caller.

Test bodies are unchanged; this is a move, not a rewrite.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@blakebauman
blakebauman merged commit 06594a4 into main Aug 13, 2026
7 checks passed
@blakebauman
blakebauman deleted the test/redistribute-hardening-tests branch August 13, 2026 03: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.

1 participant