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 reorder imports in storage tests

Steven Enamakelae7ab20cddd0
diff --git a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
index 52bdb6b629..b8bf626fab 100644
--- a/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
+++ b/crates/openhuman-core/src/agent/harness/artifact_offload/artifact_offload_tests.rs
@@ -17,8 +17,8 @@ use std::sync::Arc;
use super::*;
use crate::security::{AutonomyLevel, SecurityPolicy, TrustedAccess, TrustedRoot};
use tinyagents_harness::artifacts::{
- extract_artifact_paths, ArtifactKind, ArtifactPathPolicy, ARTIFACT_POINTER_PREFIX,
- DEFAULT_OFFLOAD_THRESHOLD_BYTES,
+ ARTIFACT_POINTER_PREFIX, ArtifactKind, ArtifactPathPolicy, DEFAULT_OFFLOAD_THRESHOLD_BYTES,
+ extract_artifact_paths,
};
/// Policy with disjoint action/workspace roots, the shipped default layout
diff --git a/crates/openhuman-core/src/cron/documents_port_tests.rs b/crates/openhuman-core/src/cron/documents_port_tests.rs
index aecdcbf96a..77cc2b4391 100644
--- a/crates/openhuman-core/src/cron/documents_port_tests.rs
+++ b/crates/openhuman-core/src/cron/documents_port_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::storage::{test_support::memory_backend, Scope, StorageBackend};
+use crate::storage::{Scope, StorageBackend, test_support::memory_backend};
use serde_json::json;
use tinyflows_bus::schedule::{DOCUMENT_INTERFACE, DOCUMENT_METHOD};
@@ -187,11 +187,12 @@ 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/storage/scope_move_tests.rs b/crates/openhuman-core/src/storage/scope_move_tests.rs
index 1d7c944669..b1cdbe7ce8 100644
--- a/crates/openhuman-core/src/storage/scope_move_tests.rs
+++ b/crates/openhuman-core/src/storage/scope_move_tests.rs
@@ -1,11 +1,11 @@
use super::*;
-use std::path::Path;
#[cfg(feature = "legacy-import")]
use crate::storage::Precondition;
#[cfg(feature = "legacy-import")]
use serde_json::json;
#[cfg(feature = "legacy-import")]
use std::io::Read;
+use std::path::Path;
use tinystoragedrivers_testkit::MemoryBackend;
use tinystoragedrivers_types::Meta;
@@ -209,18 +209,20 @@ async fn canonical_cluster_scope_import_converts_profiles_and_leases_in_place()
assert_eq!(lease.meta.expires_ms, Some(10_000));
let operator = backend.for_scope(&crate::storage::Scope::local()).unwrap();
- assert!(operator
- .documents()
- .get("profiles.registry", "alice")
- .await
- .unwrap()
- .is_none());
+ assert!(
+ operator
+ .documents()
+ .get("profiles.registry", "alice")
+ .await
+ .unwrap()
+ .is_none()
+ );
}
#[cfg(feature = "legacy-import")]
#[test]
fn boot_import_moves_profile_v1_scope_and_keeps_source_unchanged() {
- use crate::storage::layout::{legacy, Target};
+ use crate::storage::layout::{Target, legacy};
use crate::storage::{self, CollectionSpec, DocumentStoreExt, Precondition, Query, Scope};
let dir = tempfile::tempdir().unwrap();
diff --git a/crates/openhuman-core/src/storage/sessions/splice_fixture_tests.rs b/crates/openhuman-core/src/storage/sessions/splice_fixture_tests.rs
index bf74ee79ee..1c00d8b8df 100644
--- a/crates/openhuman-core/src/storage/sessions/splice_fixture_tests.rs
+++ b/crates/openhuman-core/src/storage/sessions/splice_fixture_tests.rs
@@ -8,7 +8,7 @@ use tinyagents_session::transcript::{TranscriptLocator, TranscriptMessage, Trans
/// A fresh transcript store over the driver ports on memory (the production
/// store, minus the disk), shared by cloning the `Arc`.
pub(crate) fn memory_locator() -> Arc<dyn TranscriptLocator> {
- tinyagents_session::testkit::in_memory_transcript()
+ memory_session_provider().for_agent("fixture").transcripts
}
/// A real driver-backed session provider over the TSD memory testkit. All