diff --git a/cli/cmd/release/release_test.go b/cli/cmd/release/release_test.go index 82027a3..145f683 100644 --- a/cli/cmd/release/release_test.go +++ b/cli/cmd/release/release_test.go @@ -4,11 +4,12 @@ package main // that needs a server somewhere is a test nobody runs, and this is the one tool // in the tree whose mistakes are visible to everybody who downloads a binary. // -// Every fixture points CLAUDE_PROJECT_DIR at an empty temp directory — no -// `.kettle/` marker anywhere on the way up, which is the state a fresh clone is -// in and the whole reason this tool resolves its configuration the way it does -// — and KETTLE_CONFIG_HOME at another, so a run can neither read nor overwrite -// the developer's own tokens. +// Every fixture puts BOTH anchors of the walk — CLAUDE_PROJECT_DIR and the +// working directory — in an empty temp directory, so there is no `.kettle/` +// marker anywhere on the way up. That is the state a fresh clone is in and the +// whole reason this tool resolves its configuration the way it does. It also +// points KETTLE_CONFIG_HOME at another temp directory, so a run can neither +// read nor overwrite the developer's own tokens. // // THE FAKE ANSWERS /api/v1/version, because building an SDK client is itself a // request: the SDK asks the instance what it is before it hands a client back, @@ -41,6 +42,12 @@ func harmless(t *testing.T) { t.Helper() dir := t.TempDir() t.Setenv("CLAUDE_PROJECT_DIR", dir) + // The walk has two anchors and CLAUDE_PROJECT_DIR is only the first: with + // the working directory left where `go test` put it, a run inside a tree + // that has a marker resolves that tree's config. This repository has one — + // it is gitignored, so it is present in a developer's checkout and in no + // clone — and a fixture about resolving nothing must not find it. + t.Chdir(dir) t.Setenv(config.EnvHome, filepath.Join(dir, "config")) // An exported KETTLE_URL in the developer's shell would otherwise decide // what a test resolved to, and one of these tests is about resolving