Skip to content

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

test(agent): add migration tests for artifact store

Steven Enamakel70d3a74a2c9d
diff --git a/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs b/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs
index fd52dc1120..e6edda1cd0 100644
--- a/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs
+++ b/crates/openhuman-core/src/agent/artifacts/migrate_tests.rs
@@ -4,7 +4,7 @@ use tempfile::TempDir;
use super::*;
use crate::agent::artifacts::store::{
- get_artifact, list_artifacts, read_artifact_bytes, save_artifact_args, save_artifact_meta,
+ get_artifact, list_artifacts, read_artifact_args, read_artifact_bytes, save_artifact_args, save_artifact_meta,
};
use crate::agent::artifacts::types::ArtifactKind;
@@ -109,7 +109,7 @@ async fn moves_a_legacy_file_into_the_files_folder() {
"legacy bytes removed"
);
assert!(
- ws.join("artifacts/a1/args.json").is_file(),
+ read_artifact_args(&ws, "a1").await.is_ok(),
"metadata never moves"
);
}
@@ -303,7 +303,7 @@ async fn a_crash_after_the_meta_write_is_finished_by_the_next_run() {
assert!(!legacy_path(&ws, "a1", "deck.pptx").exists());
assert_eq!(visible(&files_dir), vec!["deck.pptx"]);
assert!(
- ws.join("artifacts/a1/args.json").is_file(),
+ read_artifact_args(&ws, "a1").await.is_ok(),
"sidecars are never cleaned"
);
}