Skip to content

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

test(profiles): convert storage open error in test hosts

Steven Enamakel2452bd6b3d44
diff --git a/crates/openhuman-core/src/profiles/background_tests.rs b/crates/openhuman-core/src/profiles/background_tests.rs
index 4e975700aa..815a51d723 100644
--- a/crates/openhuman-core/src/profiles/background_tests.rs
+++ b/crates/openhuman-core/src/profiles/background_tests.rs
@@ -11,9 +11,12 @@ fn host(tmp: &tempfile::TempDir, idle_secs: u64) -> ProfileHost {
saas.idle_evict_secs = idle_secs;
let backend_path = tmp.path().join("profile-storage");
let backend_url = format!("sqlite:{}", backend_path.display());
- let backend =
- crate::storage::block_on_anyhow(async { crate::storage::open(&backend_url).await })
- .expect("profile test SQLite backend opens");
+ let backend = crate::storage::block_on_anyhow(async {
+ crate::storage::open(&backend_url)
+ .await
+ .map_err(anyhow::Error::from)
+ })
+ .expect("profile test SQLite backend opens");
ProfileHost::with_backend(
saas,
CoreContext::for_test(DomainSet::full(), None),
diff --git a/crates/openhuman-core/src/profiles/host_tests.rs b/crates/openhuman-core/src/profiles/host_tests.rs
index 583860f07a..355df0fd12 100644
--- a/crates/openhuman-core/src/profiles/host_tests.rs
+++ b/crates/openhuman-core/src/profiles/host_tests.rs
@@ -247,9 +247,12 @@ fn host(tmp: &tempfile::TempDir, max_open: usize, idle_secs: u64) -> ProfileHost
saas.idle_evict_secs = idle_secs;
let backend_path = tmp.path().join("profile-storage");
let backend_url = format!("sqlite:{}", backend_path.display());
- let backend =
- crate::storage::block_on_anyhow(async { crate::storage::open(&backend_url).await })
- .expect("profile test SQLite backend opens");
+ let backend = crate::storage::block_on_anyhow(async {
+ crate::storage::open(&backend_url)
+ .await
+ .map_err(anyhow::Error::from)
+ })
+ .expect("profile test SQLite backend opens");
ProfileHost::with_backend(
saas,
CoreContext::for_test(DomainSet::full(), None),