mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-05 23:54:50 +08:00
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.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user