Skip to content

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

test(artifacts): assert legacy import keys on folder name

Steven Enamakela87801fe21b2
diff --git a/Cargo.lock b/Cargo.lock
index 28346de39a..7fab5a4fcf 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4669,7 +4669,6 @@ dependencies = [
"env_logger",
"log",
"openhuman",
- "reqwest",
"sentry",
"serde",
"serde_json",
@@ -7914,7 +7913,6 @@ dependencies = [
"chacha20poly1305",
"fs4",
"hkdf 0.12.4",
- "keyring",
"serde_json",
"sha2 0.10.9",
"tinystoragedrivers-core",
diff --git a/crates/openhuman-core/src/agent/artifacts/store_documents_tests.rs b/crates/openhuman-core/src/agent/artifacts/store_documents_tests.rs
index e51d5506c9..10f937db45 100644
--- a/crates/openhuman-core/src/agent/artifacts/store_documents_tests.rs
+++ b/crates/openhuman-core/src/agent/artifacts/store_documents_tests.rs
@@ -93,9 +93,12 @@ fn the_legacy_files_are_imported_without_overwriting() {
// A copy under another folder name is not the record.
let copy = dir.path().join("copy-of-a");
std::fs::create_dir_all(&copy).unwrap();
- let mut stray = meta("a", 1, Some("t"));
- stray.title = "stray".into();
- std::fs::write(copy.join("meta.json"), serde_json::to_string(&stray).unwrap()).unwrap();
+ let stray = meta("z", 1, Some("t"));
+ std::fs::write(
+ copy.join("meta.json"),
+ serde_json::to_string(&stray).unwrap(),
+ )
+ .unwrap();
std::fs::write(copy.join("args.json"), r#"{"x":5}"#).unwrap();
let docs = docs_in(&MemoryStorage::new(), "local");
@@ -108,6 +111,10 @@ fn the_legacy_files_are_imported_without_overwriting() {
assert_eq!(docs.get_meta("a").unwrap().unwrap().title, "kept");
assert_eq!(docs.get_args("a").unwrap().unwrap()["x"], 9);
assert!(docs.get_meta("b").unwrap().is_some());
+ assert!(
+ docs.get_meta("z").unwrap().is_none(),
+ "folder name must match"
+ );
// Repeating it creates nothing.
assert_eq!(docs.import_legacy(dir.path()).unwrap(), 0);