Преглед изворни кода

fix: make plugin lifecycle test credential-free

Inject a dummy ANTHROPIC_API_KEY for
build_runtime_runs_plugin_lifecycle_init_and_shutdown so the test
exercises plugin init/shutdown without requiring real credentials.
The API client is constructed but never used for streaming.

Clean up the env var after the test to avoid polluting parallel tests.
Jobdori пре 2 месеци
родитељ
комит
08ed9a7980
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      rust/crates/rusty-claude-cli/src/main.rs

+ 4 - 0
rust/crates/rusty-claude-cli/src/main.rs

@@ -6805,6 +6805,9 @@ UU conflicted.rs",
     #[test]
     fn build_runtime_runs_plugin_lifecycle_init_and_shutdown() {
         let config_home = temp_dir();
+        // Inject a dummy API key so runtime construction succeeds without real credentials.
+        // This test only exercises plugin lifecycle (init/shutdown), never calls the API.
+        std::env::set_var("ANTHROPIC_API_KEY", "test-dummy-key-for-plugin-lifecycle");
         let workspace = temp_dir();
         let source_root = temp_dir();
         fs::create_dir_all(&config_home).expect("config home");
@@ -6853,6 +6856,7 @@ UU conflicted.rs",
         let _ = fs::remove_dir_all(config_home);
         let _ = fs::remove_dir_all(workspace);
         let _ = fs::remove_dir_all(source_root);
+        std::env::remove_var("ANTHROPIC_API_KEY");
     }
 }