Skip to content

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

test(storage): add e2e coverage for fallback flows

Steven Enamakel0fd340e65a9a
diff --git a/tests/storage_flows_fallback_e2e.rs b/tests/storage_flows_fallback_e2e.rs
new file mode 100644
index 0000000000..18568a106c
--- /dev/null
+++ b/tests/storage_flows_fallback_e2e.rs
@@ -0,0 +1,37 @@
+//! TinyFlows uses the workspace fallback when the host has not installed a
+//! configured storage backend.
+
+use openhuman_core::config::Config;
+use openhuman_core::flows;
+use serde_json::json;
+
+#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
+async fn flow_catalog_uses_the_workspace_fallback_without_bridge_reentry() {
+ let workspace = tempfile::tempdir().unwrap();
+ let config = Config {
+ workspace_dir: workspace.path().to_path_buf(),
+ ..Config::default()
+ };
+
+ assert!(openhuman_core::storage::installed().is_none());
+ let graph = json!({
+ "nodes": [
+ { "id": "trigger", "kind": "trigger", "name": "Manual" },
+ { "id": "agent", "kind": "agent", "name": "Summarize", "config": { "prompt": "hi" } }
+ ],
+ "edges": [{ "from_node": "trigger", "to_node": "agent" }]
+ });
+
+ let created = flows::ops::flows_create(&config, "Fallback".to_string(), graph, false)
+ .await
+ .expect("create a flow in the workspace fallback")
+ .value;
+ let listed = flows::ops::flows_list(&config)
+ .await
+ .expect("list flows in the workspace fallback")
+ .value;
+
+ assert_eq!(listed.len(), 1);
+ assert_eq!(listed[0].id, created.id);
+ assert!(workspace.path().join("storage").exists());
+}