test(runner): strip GUILD_* from the child environment - #465
Merged
Merged
Conversation
Nearly every test asserts against a bare invocation — no actor, no room — and reads the verdict back from the child's exit code. The runner spawned `node --test` without an `env`, so a `GUILD_ACTOR` exported in the developer's shell was inherited all the way down into each `spawnSync(gate.mjs)`. Paths that must fail with a missing-actor error succeeded quietly instead. Measured on 6c04c48, clean worktree + `npm ci`: GUILD_ACTOR=eris, before 26 fail / 1962 unset, before 0 fail / 1962 GUILD_ACTOR=eris, after 0 fail / 1962 The middle row is what makes the whole `GUILD_` prefix safe to strip: no test in the suite depends on the variable being set. Tests that do need an actor pass one explicitly in their own `env`. CI never saw this — GitHub runners carry no GUILD_ACTOR — so the failure was local-only and read as a broken main. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VvZueYYe3yXAkpBhbcKYqe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
tests/run.mjsspawnednode --testwithout anenv, so the wholeparent environment reached every child — including a
GUILD_ACTORexported in the developer's shell. Nearly every test asserts against
a bare invocation (no actor, no room) and reads the verdict back
from the child's exit code, so paths that must fail with a
missing-actor error succeeded quietly instead.
This strips the
GUILD_prefix from the child environment.Measured
On
6c04c48, clean worktree +npm ci:GUILD_ACTOR=erisGUILD_ACTOR=erisThe middle row is what makes stripping the whole prefix safe: no
test in the suite depends on the variable being set. Tests that do
need an actor pass one explicitly in their own
env.Why CI stayed green
GitHub runners carry no
GUILD_ACTOR, so this never reproduced inCI. The 26 failures were local-only and read as a broken
main.Scope
Test-infrastructure only — no changelog fragment (
.changelog/README.mdexcludes test-only changes).
🤖 Generated with Claude Code
https://claude.ai/code/session_01VvZueYYe3yXAkpBhbcKYqe