how do I set up the e2e tests locally? I'm getting different errors locally than in CI
- User
how do I set up the e2e tests locally? I'm getting different errors locally than in CI
Assistant· claude-opus-4-6
Here's what you need to set up E2E tests locally:
Prerequisites:
-
API keys — set the ones for the agent(s) you're testing:
ANTHROPIC_API_KEYfor Claude CodeGEMINI_API_KEYfor Gemini CLIOPENAI_API_KEYfor CodexCOPILOT_GITHUB_TOKEN(orgh auth login) for Copilot CLI
-
The agent CLI must be installed — e.g.,
claudefor Claude Code,geminifor Gemini CLI, etc. -
tmux — the tests run agents inside tmux sessions. Make sure it's installed (
brew install tmux).
Running tests:
bash# Single agent, single test mise run test:e2e --agent claude-code TestNameHere # Canary (free, no API calls) — good for verifying test infra mise run test:e2e:canaryDebugging local vs CI differences:
- Check
e2e/artifacts/after a run — it capturesconsole.log, git state, and CLI logs for every test - Set
E2E_KEEP_REPOS=1to preserve the temp repos for manual inspection - CI runs
go run ./e2e/bootstrapbefore tests for agent-specific setup (auth config, warmup) — you may need to run that locally too
Common local-only issues:
- Different agent CLI version than CI
- Missing or different API key / auth config
- Global git config differences (GPG signing, hooks, etc.)
- tmux not installed or wrong version
What specific errors are you seeing? That would help narrow it down.
-
- User
Assistant· claude-opus-4-6
Two different failures:
-
Local: OpenCode didn't create the files at all —
docs/a.md,docs/b.md,docs/c.mdare all missing (line 27-29), so the test fails immediately at the file assertions after the first prompt. -
CI: The files were created and both commits succeeded, but the shadow branch
entire/1a1b876-e3b0c4wasn't cleaned up within 10s (line 62).
These are two separate bugs:
Local failure — OpenCode isn't responding to the prompt correctly in your local environment. This is agent non-determinism, not a CLI bug. To diagnose:
- Check
e2e/artifacts/for theconsole.logfrom this run — it'll show what OpenCode actually output - Likely causes: different OpenCode version locally, different model config, or the agent asked for confirmation instead of acting
- You can re-run with to inspect the temp repo
-
- User
I don't have opencode auth I think. like, I have the agent installed but I don't have tokens or whatever
Assistant· claude-opus-4-6
That explains the local failure — OpenCode can't do anything without auth, so it produces no output and no files get created.
The test framework doesn't distinguish "agent has no auth" from "agent failed to act" — it just sees missing files.
To fix locally, either:
-
Run only the agents you have auth for:
bashmise run test:e2e --agent claude-code TestPartialCommitStashNewPrompt -
Or set up OpenCode auth — what provider does your OpenCode use? It typically needs an
OPENAI_API_KEYor similar depending on config.
The CI failure (shadow branch not cleaned up in 10s) is the real bug worth investigating. Want me to dig into that one?
-