Skip to content

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

test(storage): gate sqlite-dependent tests behind storage-sqlite

Steven Enamakelc097aabcfd96
diff --git a/crates/openhuman-core/src/storage/config_tests.rs b/crates/openhuman-core/src/storage/config_tests.rs
index b2b8ce6038..262fed5c9e 100644
--- a/crates/openhuman-core/src/storage/config_tests.rs
+++ b/crates/openhuman-core/src/storage/config_tests.rs
@@ -73,6 +73,7 @@ fn the_default_differs_per_workspace() {
}
#[tokio::test]
+#[cfg(feature = "storage-sqlite")]
async fn the_default_url_opens_in_directory_mode() {
let dir = tempfile::tempdir().unwrap();
let url = default_url(dir.path());
@@ -163,6 +164,7 @@ fn an_explicit_url_wins_over_the_v2_default() {
}
#[tokio::test]
+#[cfg(feature = "storage-sqlite")]
async fn the_v2_default_opens_one_storage_db_file_beside_config_toml() {
let tmp = tempfile::tempdir().unwrap();
let layout = v2_layout(tmp.path());
diff --git a/crates/openhuman-core/src/storage/import/layout_db_tests.rs b/crates/openhuman-core/src/storage/import/layout_db_tests.rs
index 7ad0aa6f21..cdb47bc62b 100644
--- a/crates/openhuman-core/src/storage/import/layout_db_tests.rs
+++ b/crates/openhuman-core/src/storage/import/layout_db_tests.rs
@@ -4,6 +4,7 @@ use crate::storage::layout::{Target, legacy};
use tempfile::TempDir;
#[test]
+#[cfg(feature = "storage-sqlite")]
fn the_copy_has_the_sources_counts_and_leaves_the_source_alone() {
let fx = v1_profile();
let source = legacy::v1_db(&fx.target);
@@ -24,6 +25,7 @@ fn the_copy_has_the_sources_counts_and_leaves_the_source_alone() {
}
#[test]
+#[cfg(feature = "storage-sqlite")]
fn a_matching_copy_is_kept_and_a_stale_one_replaced() {
let fx = v1_profile();
let source = legacy::v1_db(&fx.target);
diff --git a/crates/openhuman-core/src/storage/layout/credentials.rs b/crates/openhuman-core/src/storage/layout/credentials.rs
index 318efbc96b..f1c0f18e73 100644
--- a/crates/openhuman-core/src/storage/layout/credentials.rs
+++ b/crates/openhuman-core/src/storage/layout/credentials.rs
@@ -158,6 +158,6 @@ pub async fn import(target: &Target) -> Result<Vec<String>, LayoutError> {
Ok(imported)
}
-#[cfg(all(test, feature = "legacy-import"))]
+#[cfg(all(test, feature = "legacy-import", feature = "storage-sqlite"))]
#[path = "credentials_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/storage/layout/legacy.rs b/crates/openhuman-core/src/storage/layout/legacy.rs
index e03b9d7852..f708b18964 100644
--- a/crates/openhuman-core/src/storage/layout/legacy.rs
+++ b/crates/openhuman-core/src/storage/layout/legacy.rs
@@ -150,6 +150,6 @@ pub async fn migrate(target: &Target) -> Result<(), LayoutError> {
Ok(())
}
-#[cfg(test)]
+#[cfg(all(test, feature = "storage-sqlite"))]
#[path = "legacy_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/storage/layout/plan.rs b/crates/openhuman-core/src/storage/layout/plan.rs
index 2d3b8cd7d1..ad6ebfa73b 100644
--- a/crates/openhuman-core/src/storage/layout/plan.rs
+++ b/crates/openhuman-core/src/storage/layout/plan.rs
@@ -262,6 +262,6 @@ pub fn join(base: &Path, rel: &str) -> PathBuf {
.fold(base.to_path_buf(), |p, part| p.join(part))
}
-#[cfg(test)]
+#[cfg(all(test, feature = "storage-sqlite"))]
#[path = "plan_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/storage/layout/run.rs b/crates/openhuman-core/src/storage/layout/run.rs
index d47ffd2182..6f444a1124 100644
--- a/crates/openhuman-core/src/storage/layout/run.rs
+++ b/crates/openhuman-core/src/storage/layout/run.rs
@@ -491,6 +491,6 @@ pub async fn auto_migrate(config: &Config) -> bool {
}
}
-#[cfg(test)]
+#[cfg(all(test, feature = "storage-sqlite"))]
#[path = "run_tests.rs"]
mod tests;
diff --git a/crates/openhuman-core/src/storage/rebind_tests.rs b/crates/openhuman-core/src/storage/rebind_tests.rs
index 5bbe92f39d..871619c7c2 100644
--- a/crates/openhuman-core/src/storage/rebind_tests.rs
+++ b/crates/openhuman-core/src/storage/rebind_tests.rs
@@ -35,6 +35,7 @@ impl Installed {
}
#[test]
+#[cfg(feature = "storage-sqlite")]
fn a_different_workspace_reopens_the_default_backend_there() {
let first = TempDir::new().unwrap();
let second = TempDir::new().unwrap();
@@ -57,6 +58,7 @@ fn a_different_workspace_reopens_the_default_backend_there() {
}
#[test]
+#[cfg(feature = "storage-sqlite")]
fn the_new_workspace_is_a_different_database() {
let first = TempDir::new().unwrap();
let second = TempDir::new().unwrap();
@@ -99,7 +101,7 @@ fn the_new_workspace_is_a_different_database() {
}
#[test]
-#[cfg(feature = "legacy-import")]
+#[cfg(all(feature = "legacy-import", feature = "storage-sqlite"))]
fn the_legacy_files_of_the_new_workspace_are_imported() {
let first = TempDir::new().unwrap();
let second = TempDir::new().unwrap();
@@ -194,6 +196,7 @@ fn a_backend_that_cannot_be_opened_keeps_the_previous_one() {
}
#[test]
+#[cfg(feature = "storage-sqlite")]
fn rebinding_to_a_fresh_v2_profile_opens_its_storage_db_and_leaves_a_v1_one_alone() {
let root = TempDir::new().unwrap();
let v1 = TempDir::new().unwrap();