fix: make startup_banner test credential-free

Remove the #[ignore] gate from startup_banner_mentions_workflow_completions
by injecting a dummy ANTHROPIC_API_KEY. The test exercises LiveCli banner
rendering, not API calls. Cleanup env var after test.

Test suite now 102/102 in CLI crate (was 101 + 1 ignored).
This commit is contained in:
Jobdori
2026-04-03 07:04:30 +09:00
parent 08ed9a7980
commit 06151c57f3

View File

@@ -5796,9 +5796,10 @@ mod tests {
}
#[test]
#[ignore = "requires ANTHROPIC_API_KEY"]
fn startup_banner_mentions_workflow_completions() {
let _guard = env_lock();
// Inject dummy credentials so LiveCli can construct without real Anthropic key
std::env::set_var("ANTHROPIC_API_KEY", "test-dummy-key-for-banner-test");
let root = temp_dir();
fs::create_dir_all(&root).expect("root dir");
@@ -5817,6 +5818,7 @@ mod tests {
assert!(banner.contains("workflow completions"));
fs::remove_dir_all(root).expect("cleanup temp dir");
std::env::remove_var("ANTHROPIC_API_KEY");
}
#[test]