Browse Source

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).
Jobdori 2 months ago
parent
commit
06151c57f3
1 changed files with 3 additions and 1 deletions
  1. 3 1
      rust/crates/rusty-claude-cli/src/main.rs

+ 3 - 1
rust/crates/rusty-claude-cli/src/main.rs

@@ -5796,9 +5796,10 @@ mod tests {
     }
     }
 
 
     #[test]
     #[test]
-    #[ignore = "requires ANTHROPIC_API_KEY"]
     fn startup_banner_mentions_workflow_completions() {
     fn startup_banner_mentions_workflow_completions() {
         let _guard = env_lock();
         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();
         let root = temp_dir();
         fs::create_dir_all(&root).expect("root dir");
         fs::create_dir_all(&root).expect("root dir");
 
 
@@ -5817,6 +5818,7 @@ mod tests {
         assert!(banner.contains("workflow completions"));
         assert!(banner.contains("workflow completions"));
 
 
         fs::remove_dir_all(root).expect("cleanup temp dir");
         fs::remove_dir_all(root).expect("cleanup temp dir");
+        std::env::remove_var("ANTHROPIC_API_KEY");
     }
     }
 
 
     #[test]
     #[test]