Skip to content

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

test(artifacts): update production test assertions for artifact file access

Steven Enamakel86b8099c2724
diff --git a/crates/openhuman-core/src/artifacts/production_tests.rs b/crates/openhuman-core/src/artifacts/production_tests.rs
index f48b568bfe..2f15e2a4fa 100644
--- a/crates/openhuman-core/src/artifacts/production_tests.rs
+++ b/crates/openhuman-core/src/artifacts/production_tests.rs
@@ -92,7 +92,11 @@ async fn a_new_artifact_shares_one_id_and_one_file_between_card_and_record() {
let kept = crate::artifacts::tiny_store::version_files_dir(&workspace)
.join(&id)
.join("v1.pptx");
- assert_eq!(std::path::Path::new(&file.path), kept.as_path());
+ assert_eq!(file.key, format!("artifacts/files/{id}/v1.pptx"));
+ let ctx = crate::core::runtime::DispatchCtx::process_default();
+ let file_store = super::super::tiny_store::file_store_for(&workspace, &ctx).unwrap();
+ assert_eq!(file_store.read(&file.key).await.unwrap(), b"deck-v1");
+ assert!(kept.is_dir(), "version blobs use the storage port, not workspace files");
assert_eq!(
files_in(&files),
vec!["quarterly-deck.pptx"],
@@ -120,9 +124,11 @@ async fn a_revision_reuses_the_id_and_file_and_keeps_the_history() {
b"deck-v2!"
);
// Each version still holds what it was.
- let bytes_of = |n: u32| std::fs::read(&record.version(n).unwrap().file.clone().unwrap().path);
- assert_eq!(bytes_of(1).unwrap(), b"deck-v1");
- assert_eq!(bytes_of(2).unwrap(), b"deck-v2!");
+ let ctx = crate::core::runtime::DispatchCtx::process_default();
+ let file_store = super::super::tiny_store::file_store_for(&workspace, &ctx).unwrap();
+ let key_of = |n: u32| record.version(n).unwrap().file.clone().unwrap().key;
+ assert_eq!(file_store.read(&key_of(1)).await.unwrap(), b"deck-v1");
+ assert_eq!(file_store.read(&key_of(2)).await.unwrap(), b"deck-v2!");
}
#[tokio::test]