Skip to content

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

test(channels): isolate sqlite storage in channel controller tests

Steven Enamakelec8cf9475e03
diff --git a/crates/openhuman-core/src/channels/controllers/ops/connect/memory_tests.rs b/crates/openhuman-core/src/channels/controllers/ops/connect/memory_tests.rs
index d53d71b0cc..2b5bc1eade 100644
--- a/crates/openhuman-core/src/channels/controllers/ops/connect/memory_tests.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops/connect/memory_tests.rs
@@ -332,6 +332,8 @@ async fn reserved_channel_thread_id_survives_metadata_edit_without_prefix_collis
let mut config = Config::default();
config.workspace_dir = tmp.path().to_path_buf();
config.memory.engine.clear();
+ #[cfg(feature = "storage-sqlite")]
+ crate::storage::local::use_persistent_default_for_test(&config.workspace_dir);
use_linked_channel_module(&mut config).await;
let ctx = DispatchCtx::ambient();
let target = store_channel_thread(
diff --git a/crates/openhuman-core/src/channels/controllers/ops_tests.rs b/crates/openhuman-core/src/channels/controllers/ops_tests.rs
index d3733d9728..ea97ce9fe2 100644
--- a/crates/openhuman-core/src/channels/controllers/ops_tests.rs
+++ b/crates/openhuman-core/src/channels/controllers/ops_tests.rs
@@ -12,6 +12,8 @@ fn isolated_test_config() -> (tempfile::TempDir, Config) {
config.workspace_dir = tmp.path().join("workspace");
config.config_path = tmp.path().join("config.toml");
std::fs::create_dir_all(&config.workspace_dir).expect("failed to create workspace dir");
+ #[cfg(feature = "storage-sqlite")]
+ crate::storage::local::use_persistent_default_for_test(&config.workspace_dir);
(tmp, config)
}