Skip to content

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

test(storage): restrict test environment to sqlite feature

Steven Enamakel97ab1408e58e
diff --git a/crates/openhuman-core/src/storage/local.rs b/crates/openhuman-core/src/storage/local.rs
index 70e3407f4e..7ad85c28a4 100644
--- a/crates/openhuman-core/src/storage/local.rs
+++ b/crates/openhuman-core/src/storage/local.rs
@@ -53,11 +53,11 @@ type WorkspaceBackend = Arc<tokio::sync::OnceCell<Arc<dyn StorageBackend>>>;
static WORKSPACES: LazyLock<Mutex<HashMap<PathBuf, WorkspaceBackend>>> =
LazyLock::new(Mutex::default);
-#[cfg(test)]
+#[cfg(all(test, feature = "storage-sqlite"))]
static TEST_WORKSPACE_URLS: LazyLock<Mutex<HashMap<PathBuf, String>>> =
LazyLock::new(Mutex::default);
-#[cfg(test)]
+#[cfg(all(test, feature = "storage-sqlite"))]
pub(super) fn use_persistent_default_for_test(workspace_dir: &Path) {
TEST_WORKSPACE_URLS
.lock()
@@ -135,7 +135,7 @@ async fn open_default_backend(workspace_dir: PathBuf) -> Result<Arc<dyn StorageB
#[cfg(test)]
await_test_backend_open_gate().await;
- #[cfg(test)]
+ #[cfg(all(test, feature = "storage-sqlite"))]
{
let persistent_url = TEST_WORKSPACE_URLS
.lock()
@@ -153,7 +153,10 @@ async fn open_default_backend(workspace_dir: PathBuf) -> Result<Arc<dyn StorageB
format!("open the default storage for {}", workspace_dir.display())
});
}
+ }
+ #[cfg(test)]
+ {
let backend: Arc<dyn StorageBackend> =
Arc::new(tinystoragedrivers_testkit::MemoryBackend::new());
super::boot::prepare_and_migrate(&backend).await?;
diff --git a/crates/openhuman-core/src/storage/local_tests.rs b/crates/openhuman-core/src/storage/local_tests.rs
index 9db02aa429..3890be5354 100644
--- a/crates/openhuman-core/src/storage/local_tests.rs
+++ b/crates/openhuman-core/src/storage/local_tests.rs
@@ -53,6 +53,7 @@ fn workspaces_do_not_share_a_default() {
}
#[test]
+#[cfg(feature = "storage-sqlite")]
// Persistence test: forgetting the process cache models a restart and must
// reopen the same durable workspace data.
fn forgetting_a_workspace_reopens_the_same_data() {