Skip to content

test: keep the developer's gateway key out of the test environment - #11

Merged
thymikee merged 1 commit into
mainfrom
t3/hermetic-test-env
Oct 14, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3/hermetic-test-env

Conversation

@thymikee

Copy link
Copy Markdown
Member

npm test failed locally on main (10 tests) when AI_GATEWAY_API_KEY is exported. The test fixture starts from process.env and sets CALLSTACK_AUTH_TOKEN, so with both keys present defaultProvider() picks Vercel AI Gateway and every test that expects the Callstack portal fails. CI never saw it because it has no keys.

  • The fixture now removes every gateway key except the Callstack one it sets.
  • It also removes XDG_DATA_HOME, so OpenCode's key-store lookup can't reach the developer's real auth.json.

npm test: 65/65 pass both with and without AI_GATEWAY_API_KEY / XDG_DATA_HOME set.

🤖 Generated with Claude Code

The fixture copied process.env, so an exported AI_GATEWAY_API_KEY made the
default gateway Vercel and broke every test expecting the Callstack portal.
Drop non-Callstack gateway keys and XDG_DATA_HOME (OpenCode's key store) too.
@thymikee
thymikee merged commit bace670 into main Oct 14, 2026
2 checks passed
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