Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(mcp): use shared sqlite test backend in dispatch policy test

Steven Enamakel81ee8de1421d
diff --git a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
index b89538b8fa..c9ed484371 100644
--- a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
+++ b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
@@ -160,15 +160,11 @@ async fn call_tool_judges_the_policy_of_the_explicit_context_across_scopes() {
allowing.action_dir = tmp_allow.path().to_path_buf();
// Validating tool arguments calls the tinymcp module, which reaches the
// host's installed storage.
- // The module resolves the installed storage from the process environment,
- // so the env lock and the ambient install guard it like the sibling tests.
- let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", tmp_allow.path());
- }
- let ambient = AmbientStorage::install();
- denying.storage.url = Some(ambient._fixture.url.clone());
- allowing.storage.url = Some(ambient._fixture.url.clone());
+ let storage = crate::storage::test_support::sqlite_backend().expect("SQLite test backend");
+ let _storage_guard =
+ crate::storage::test_support::install_for_test(&storage.url, Arc::clone(&storage.backend));
+ denying.storage.url = Some(storage.url.clone());
+ allowing.storage.url = Some(storage.url.clone());
let deny_core = CoreContext::for_test_with_config(DomainSet::full(), denying);
let allow_core = CoreContext::for_test_with_config(DomainSet::full(), allowing);
@@ -198,7 +194,4 @@ async fn call_tool_judges_the_policy_of_the_explicit_context_across_scopes() {
"the permissive context reaches agent construction: {}",
allowed.message()
);
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
}