From af408dc66cd5fe26f84090ac83a949c715b4dd00 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Wed, 15 Apr 2026 11:22:02 -0400 Subject: [PATCH] fix(tests): make bulk_skip model test independent of local credentials MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The snapshot was overfit to local env — it hardcoded Anthropic models passing because the server inherited ANTHROPIC_API_KEY from the test runner. On CI with no API keys, all models are skipped and the snapshot diverged. Replace the snapshot with targeted assertions: exit code 0 and "Skipped" appears in stderr. This works regardless of which credentials are available in the test environment. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../fabro-cli/tests/it/cmd/model_test.rs | 44 +++++-------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/lib/crates/fabro-cli/tests/it/cmd/model_test.rs b/lib/crates/fabro-cli/tests/it/cmd/model_test.rs index 45103ef8b..a0a89a3c8 100644 --- a/lib/crates/fabro-cli/tests/it/cmd/model_test.rs +++ b/lib/crates/fabro-cli/tests/it/cmd/model_test.rs @@ -82,38 +82,18 @@ fn bulk_skip_exits_zero_and_prints_summary() { cmd.args(["model", "test"]); remove_provider_env(&mut cmd); - fabro_snapshot!(context.filters(), cmd, @" - success: true - exit_code: 0 - ----- stdout ----- - MODEL PROVIDER ALIASES CONTEXT COST SPEED RESULT - claude-opus-4-6 anthropic opus, claude-opus 1m $5.0 / $25.0 25 tok/s ok - claude-sonnet-4-5 anthropic 200k $3.0 / $15.0 50 tok/s ok - claude-sonnet-4-6 anthropic sonnet, claude-sonnet 200k $3.0 / $15.0 50 tok/s ok - claude-haiku-4-5 anthropic haiku, claude-haiku 200k $0.8 / $4.0 100 tok/s ok - ----- stderr ----- - Testing claude-opus-4-6... done - Testing claude-sonnet-4-5... done - Testing claude-sonnet-4-6... done - Testing claude-haiku-4-5... done - Testing gpt-5.2... done - Testing gpt-5-mini... done - Testing gpt-5.2-codex... done - Testing gpt-5.3-codex... done - Testing gpt-5.3-codex-spark... done - Testing gpt-5.4... done - Testing gpt-5.4-pro... done - Testing gpt-5.4-mini... done - Testing gemini-3.1-pro-preview... done - Testing gemini-3.1-pro-preview-customtools... done - Testing gemini-3-flash-preview... done - Testing gemini-3.1-flash-lite-preview... done - Testing kimi-k2.5... done - Testing glm-4.7... done - Testing minimax-m2.5... done - Testing mercury-2... done - Skipped 16 model(s) (no credentials: OpenAI, Gemini, Kimi, Zai, Minimax, Inception) - "); + let output = cmd.output().expect("command should execute"); + assert!( + output.status.success(), + "bulk skip should exit 0:\nstdout:\n{}\nstderr:\n{}", + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr), + ); + let stderr = String::from_utf8_lossy(&output.stderr); + assert!( + stderr.contains("Skipped"), + "should report skipped models:\n{stderr}" + ); } #[test]