Skip to content

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

refactor(tests): chain workflow access after unwrap

Steven Enamakelc87bf059602d
diff --git a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
index 43eed44a69..777673cda0 100644
--- a/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
+++ b/crates/openhuman-core/src/flows/builder_tools_validate_and_create_tests.rs
@@ -133,7 +133,8 @@ async fn edit_workflow_does_not_persist_an_incompatible_saved_child_reference()
false,
false,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let safe_graph = json!({
"nodes": [
{ "id": "t", "kind": "trigger", "name": "Trigger" },
diff --git a/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs b/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
index bc14b01dfc..5d61bbfd0e 100644
--- a/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_approval_manifest_and_catalog_tests.rs
@@ -11,7 +11,8 @@ async fn flows_run_detached_returns_running_run_id_and_inserts_row() {
false,
true,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let outcome = flows_run_detached(
&crate::core::runtime::DispatchCtx::ambient(),
@@ -55,7 +56,8 @@ async fn flows_run_detached_registers_the_run_before_returning_its_id() {
false,
true,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let outcome = flows_run_detached(
&crate::core::runtime::DispatchCtx::ambient(),
diff --git a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
index 81b7720dda..d8578fce12 100644
--- a/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_engine_compatibility_tests.rs
@@ -11,7 +11,8 @@ async fn resolver_lookup_rejects_an_incompatible_saved_child() {
false,
false,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let error = load_engine_compatible_flow_graph(
&crate::core::runtime::DispatchCtx::ambient(),
@@ -38,7 +39,8 @@ async fn resolver_lookup_rejects_an_incompatible_saved_grandchild() {
false,
false,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let child = store::create_flow(
&config,
"saved child".to_string(),
@@ -46,7 +48,8 @@ async fn resolver_lookup_rejects_an_incompatible_saved_grandchild() {
false,
false,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let error = load_engine_compatible_flow_graph(
&crate::core::runtime::DispatchCtx::ambient(),
@@ -89,7 +92,9 @@ async fn flows_run_rejects_legacy_nested_conditional_fan_in_before_execution() {
// Bypass the current author-time gate to simulate a definition persisted
// by an older OpenHuman build. Reads remain supported; execution does not.
let graph = structurally_valid_graph(nested_conditional_fan_in_graph());
- let flow = store::create_flow(&config, "legacy".to_string(), graph, false, true).unwrap();
+ let flow = store::create_flow(&config, "legacy".to_string(), graph, false, true)
+ .unwrap()
+ .workflow;
let err = flows_run(
&crate::core::runtime::DispatchCtx::ambient(),
@@ -122,7 +127,8 @@ async fn flows_run_rejects_an_incompatible_saved_child_before_execution() {
false,
false,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let parent = store::create_flow(
&config,
"parent".to_string(),
@@ -130,7 +136,8 @@ async fn flows_run_rejects_an_incompatible_saved_child_before_execution() {
false,
true,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let error = flows_run(
&crate::core::runtime::DispatchCtx::ambient(),
@@ -157,7 +164,9 @@ async fn flows_update_allows_metadata_only_edits_of_legacy_incompatible_graph()
let tmp = TempDir::new().unwrap();
let config = test_config(&tmp);
let graph = structurally_valid_graph(nested_conditional_fan_in_graph());
- let flow = store::create_flow(&config, "legacy".to_string(), graph, false, false).unwrap();
+ let flow = store::create_flow(&config, "legacy".to_string(), graph, false, false)
+ .unwrap()
+ .workflow;
let updated = flows_update(
&config,
@@ -186,7 +195,8 @@ async fn flows_create_rejects_an_incompatible_saved_child_before_persisting() {
false,
false,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let error = flows_create(
&config,
@@ -218,7 +228,8 @@ async fn flows_update_rejects_an_incompatible_saved_child_before_persisting() {
false,
false,
)
- .unwrap();
+ .unwrap()
+ .workflow;
let original_graph = structurally_valid_graph(trigger_only_graph());
let parent = store::create_flow(
&config,
diff --git a/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs b/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs
index c45893d21e..03d90b1c9d 100644
--- a/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_migration_and_side_effect_tests.rs
@@ -65,7 +65,8 @@ async fn flows_create_schedule_trigger_creates_disabled() {
false,
)
.await
- .unwrap();
+ .unwrap()
+ .workflow;
assert!(
!created.value.enabled,
@@ -99,7 +100,8 @@ async fn flows_create_app_event_trigger_creates_disabled() {
false,
)
.await
- .unwrap();
+ .unwrap()
+ .workflow;
assert!(
!created.value.enabled,
@@ -174,7 +176,8 @@ async fn flows_create_outbound_http_forces_require_approval() {
false,
)
.await
- .unwrap();
+ .unwrap()
+ .workflow;
assert!(
created.value.require_approval,
@@ -209,7 +212,8 @@ async fn flows_create_readonly_graph_respects_caller_require_approval() {
false,
)
.await
- .unwrap();
+ .unwrap()
+ .workflow;
assert!(
!created.value.require_approval,
diff --git a/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rs b/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rs
index 76e7e19dba..610b8c5f76 100644
--- a/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rs
+++ b/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rs
@@ -16,7 +16,8 @@ async fn flows_resume_marks_an_incompatible_legacy_checkpoint_failed() {
FlowRunTrigger::Rpc,
)
.await
- .unwrap();
+ .unwrap()
+ .workflow;
let thread_id = run.value["thread_id"].as_str().unwrap().to_string();
let pending: Vec<String> =
serde_json::from_value(run.value["pending_approvals"].clone()).unwrap();