fix(tests): isolate bulk_skip model test from shared vault state

Other tests in the workspace (e.g. secret_list_json_returns_metadata_only)
write ANTHROPIC_API_KEY to the shared session daemon's vault. When that
test runs before bulk_skip_exits_zero_and_prints_summary, the shared
server resolves Anthropic as configured via vault env-lookup fallback,
attempts to call the real Anthropic API with the leaked test value, and
fails with a 401 "invalid x-api-key" instead of returning a skip.

Spawn an isolated server with a fresh vault so the bulk test's "no
credentials configured" precondition holds regardless of which other
tests share the nextest session.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-05-13 11:56:23 -04:00
parent 68ab756040
commit 87ddfafef1
No known key found for this signature in database

View file

@ -135,7 +135,12 @@ fn single_model_skip_exits_nonzero() {
#[test]
fn bulk_skip_exits_zero_and_prints_summary() {
let context = test_context!();
let mut context = test_context!();
context.write_home(
".fabro/settings.toml",
"[server.auth]\nmethods = [\"dev-token\"]\n",
);
context.isolated_server();
let mut cmd = context.command();
cmd.args(["model", "test"]);
remove_provider_env(&mut cmd);