Skip to content

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

test: reformat assertions and imports in storage tests

Steven Enamakelef7319294ef1
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
index 559b5200a2..8deda2f6f2 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_sessions/store_documents_tests.rs
@@ -35,12 +35,10 @@ fn session(id: &str) -> DurableSubagentSession {
#[test]
fn a_missing_list_loads_empty() {
- assert!(
- docs_in(memory_backend().as_ref(), "local")
- .load()
- .unwrap()
- .is_empty()
- );
+ assert!(docs_in(memory_backend().as_ref(), "local")
+ .load()
+ .unwrap()
+ .is_empty());
}
#[test]
@@ -83,11 +81,10 @@ fn the_store_uses_the_workspace_default_with_no_backend_installed() {
store.save(&[session("a")]).unwrap();
assert_eq!(store.load().unwrap().len(), 1);
// No JSON file store: the records are in the workspace's own database.
- assert!(
- !dir.path()
- .join(".openhuman/subagent_sessions.json")
- .exists()
- );
+ assert!(!dir
+ .path()
+ .join(".openhuman/subagent_sessions.json")
+ .exists());
assert!(dir.path().join("storage").exists());
}
@@ -120,11 +117,10 @@ fn the_store_dispatches_to_documents_when_a_backend_is_pinned() {
assert_eq!(store.load().unwrap().len(), 1);
});
assert_eq!(docs.load().unwrap().len(), 1);
- assert!(
- !dir.path()
- .join(".openhuman/subagent_sessions.json")
- .exists()
- );
+ assert!(!dir
+ .path()
+ .join(".openhuman/subagent_sessions.json")
+ .exists());
}
#[test]
diff --git a/crates/openhuman-core/src/cron/documents_port_tests.rs b/crates/openhuman-core/src/cron/documents_port_tests.rs
index 2779366c8c..4e57f6e933 100644
--- a/crates/openhuman-core/src/cron/documents_port_tests.rs
+++ b/crates/openhuman-core/src/cron/documents_port_tests.rs
@@ -187,12 +187,11 @@ async fn shared_schedule_records_are_owner_scoped_and_never_scanned() {
)
.await;
assert!(record.get("error").is_none(), "{record}");
- assert!(
- docs.get("tsd.counters", "cron/runs")
- .await
- .unwrap()
- .is_some()
- );
+ assert!(docs
+ .get("tsd.counters", "cron/runs")
+ .await
+ .unwrap()
+ .is_some());
let requests = [
json!({"op":"get","collection":"tsd.counters","id":"other/runs"}),
diff --git a/crates/openhuman-core/src/profiles/storage_schema_tests.rs b/crates/openhuman-core/src/profiles/storage_schema_tests.rs
index 84188232a8..7ac9049db5 100644
--- a/crates/openhuman-core/src/profiles/storage_schema_tests.rs
+++ b/crates/openhuman-core/src/profiles/storage_schema_tests.rs
@@ -1,7 +1,7 @@
use super::*;
+use crate::storage::test_support::sqlite_backend;
use serde_json::json;
use std::sync::Arc;
-use crate::storage::test_support::sqlite_backend;
use tinystoragedrivers::{Meta, Precondition, Scope};
#[test]
@@ -55,13 +55,16 @@ async fn migrate_cluster_moves_the_v1_registry_into_the_v2_collection() {
#[test]
fn the_schema_composes_under_its_owner() {
- assert_eq!(collection_specs(), vec![CollectionSpec::new(REGISTRY_COLLECTION)]);
+ assert_eq!(
+ collection_specs(),
+ vec![CollectionSpec::new(REGISTRY_COLLECTION)]
+ );
}
#[tokio::test]
#[cfg(feature = "storage-sqlite")]
async fn migrate_cluster_moves_v1_leases_into_tsd_leases_and_keeps_their_epoch() {
- use crate::storage::lease::{DocumentLeases, LEASE_OWNER, LeaseStore};
+ use crate::storage::lease::{DocumentLeases, LeaseStore, LEASE_OWNER};
let fixture = sqlite_backend().unwrap();
let backend = Arc::clone(&fixture.backend);
let scoped = backend.for_scope(&Scope::cluster()).unwrap();
diff --git a/crates/openhuman-core/src/storage/scope_move_tests.rs b/crates/openhuman-core/src/storage/scope_move_tests.rs
index 41cefb5c93..23d4f4a80e 100644
--- a/crates/openhuman-core/src/storage/scope_move_tests.rs
+++ b/crates/openhuman-core/src/storage/scope_move_tests.rs
@@ -346,7 +346,10 @@ fn boot_import_reports_no_source_for_a_new_mongodb_target() {
.iter()
.find(|report| report.domain == IMPORT_DOMAIN)
.expect("scope migration is in the boot importer pipeline");
- assert_eq!(report.outcome, Ok(crate::storage::import::Outcome::NoSource));
+ assert_eq!(
+ report.outcome,
+ Ok(crate::storage::import::Outcome::NoSource)
+ );
}
#[cfg(feature = "legacy-import")]