Skip to content

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

test(media-generation-e2e): update test to reflect artifact storage split

Steven Enamakel5bcd6f9f4b75
diff --git a/tests/media_generation_e2e.rs b/tests/media_generation_e2e.rs
index f3502e1975..0cda42a64b 100644
--- a/tests/media_generation_e2e.rs
+++ b/tests/media_generation_e2e.rs
@@ -180,13 +180,16 @@ async fn media_tools_deliver_images_and_videos_through_the_backend_proxy() {
let (api_url, backend) = start_backend().await;
let config = config(tmp.path(), &api_url);
let action_dir = tmp.path().join("projects");
+ // Deliverables land in the visible Files folder (#5505); only each
+ // artifact's `meta.json` stays in the hidden workspace store.
+ let files_dir = tmp.path().join("Files");
let generators = managed_generators(&config).expect("backend transport is installed");
let tools = media_tools_from(
generators,
&action_dir,
&config.workspace_dir,
- openhuman_core::agent::artifacts::FileRoots::from_config(&config),
+ &files_dir,
WaitPolicy::new(Duration::from_millis(5), Duration::from_secs(20)),
);
@@ -251,20 +254,27 @@ async fn media_tools_deliver_images_and_videos_through_the_backend_proxy() {
0,
"filed media must leave the staging directory"
);
- let mut saved: Vec<(String, Vec<u8>)> = [image_id, video_id]
- .iter()
- .flat_map(|id| {
+ for id in [&image_id, &video_id] {
+ let entries: Vec<String> =
std::fs::read_dir(config.workspace_dir.join("artifacts").join(id))
- .expect("filed artifact directory")
- .map(|entry| entry.unwrap().path())
- .filter(|path| path.extension().is_some_and(|ext| ext != "json"))
- .map(|path| {
- (
- path.extension().unwrap().to_string_lossy().into_owned(),
- std::fs::read(&path).unwrap(),
- )
- })
- .collect::<Vec<_>>()
+ .expect("filed artifact record")
+ .map(|entry| entry.unwrap().file_name().to_string_lossy().into_owned())
+ .collect();
+ assert_eq!(
+ entries,
+ vec!["meta.json".to_string()],
+ "only the record stays hidden"
+ );
+ }
+ let mut saved: Vec<(String, Vec<u8>)> = std::fs::read_dir(&files_dir)
+ .expect("visible files folder")
+ .map(|entry| entry.unwrap().path())
+ .filter(|path| path.is_file())
+ .map(|path| {
+ (
+ path.extension().unwrap().to_string_lossy().into_owned(),
+ std::fs::read(&path).unwrap(),
+ )
})
.collect();
saved.sort();