The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(flows): update various operation tests with formatting and minor adjustments
Steven Enamakel1e9955ef10fa
diff --git a/crates/openhuman-core/src/flows/ops_builder_repair_tests.rs b/crates/openhuman-core/src/flows/ops_builder_repair_tests.rsindex 0319800102..8ad1591bdd 100644--- a/crates/openhuman-core/src/flows/ops_builder_repair_tests.rs+++ b/crates/openhuman-core/src/flows/ops_builder_repair_tests.rs@@ -3,48 +3,60 @@ use super::*;use crate::core::runtime::DispatchCtx;use crate::{config::Config,- flows::ops::{flows_build_with_extra_hidden_tools, FlowStreamTarget},+ flows::ops::{FlowStreamTarget, flows_build_with_extra_hidden_tools},};#[tokio::test]async fn classifies_backend_failures_without_classifying_graph_timeouts() {let config = Config::default();- assert!(is_backend_or_infrastructure_failure(- &config,- "File upload failed: Backend returned 500 Internal Server Error"- )- .await- .unwrap());- assert!(!is_backend_or_infrastructure_failure(- &config,- "File upload failed: Backend returned 400 Bad Request"- )- .await- .unwrap());- assert!(is_backend_or_infrastructure_failure(- &config,- "connection timed out while calling file storage"- )- .await- .unwrap());- assert!(is_backend_or_infrastructure_failure(- &config,- "POST https://api.example.test/files failed: connection timed out"- )- .await- .unwrap());- assert!(!is_backend_or_infrastructure_failure(- &config,- "agent node fetch_profile timed out after 30 seconds"- )- .await- .unwrap());- assert!(!is_backend_or_infrastructure_failure(- &config,- "required argument resolved null: nodes.get_link.item.json.url"- )- .await- .unwrap());+ assert!(+ is_backend_or_infrastructure_failure(+ &config,+ "File upload failed: Backend returned 500 Internal Server Error"+ )+ .await+ .unwrap()+ );+ assert!(+ !is_backend_or_infrastructure_failure(+ &config,+ "File upload failed: Backend returned 400 Bad Request"+ )+ .await+ .unwrap()+ );+ assert!(+ is_backend_or_infrastructure_failure(+ &config,+ "connection timed out while calling file storage"+ )+ .await+ .unwrap()+ );+ assert!(+ is_backend_or_infrastructure_failure(+ &config,+ "POST https://api.example.test/files failed: connection timed out"+ )+ .await+ .unwrap()+ );+ assert!(+ !is_backend_or_infrastructure_failure(+ &config,+ "agent node fetch_profile timed out after 30 seconds"+ )+ .await+ .unwrap()+ );+ assert!(+ !is_backend_or_infrastructure_failure(+ &config,+ "required argument resolved null: nodes.get_link.item.json.url"+ )+ .await+ .unwrap()+ );}#[tokio::test]@@ -56,13 +68,15 @@ async fn backend_repair_message_explains_why_the_graph_was_preserved() {assert!(message.contains("workflow was not changed"));assert!(message.contains("HTTP 503 from file storage"));- assert!(backend_repair_message(- &Config::default(),- "agent node fetch_profile timed out after 30 seconds",- )- .await- .unwrap()- .is_none());+ assert!(+ backend_repair_message(+ &Config::default(),+ "agent node fetch_profile timed out after 30 seconds",+ )+ .await+ .unwrap()+ .is_none()+ );}#[test]@@ -97,10 +111,12 @@ fn repair_backend_failure_returns_no_proposal_before_starting_the_builder() {assert_eq!(outcome.value["proposal"], Value::Null);assert_eq!(outcome.value["error"], Value::Null);- assert!(outcome.value["assistant_text"]- .as_str()- .expect("assistant text")- .contains("workflow was not changed"));+ assert!(+ outcome.value["assistant_text"]+ .as_str()+ .expect("assistant text")+ .contains("workflow was not changed")+ );let request_id = format!("backend-repair-{}", uuid::Uuid::new_v4());let stream = FlowStreamTarget {@@ -128,10 +144,11 @@ fn repair_backend_failure_returns_no_proposal_before_starting_the_builder() {};assert_eq!(done.event, "chat_done");assert_eq!(done.thread_id, "backend-repair-thread");- assert!(done- .full_response- .as_deref()- .expect("terminal response text")- .contains("workflow was not changed"));+ assert!(+ done.full_response+ .as_deref()+ .expect("terminal response text")+ .contains("workflow was not changed")+ );});}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.rsindex 4f1878ba28..0bd6d8eebd 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@@ -334,13 +334,15 @@ async fn flows_update_does_not_force_require_approval_on_readonly_graph() {async fn strict_gate_passes_a_valid_graph_and_rejects_a_structurally_invalid_one() {let config = Config::default();// A trigger-only graph is structurally valid and has no outbound gates.- assert!(strict_gate(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- &trigger_only_graph()- )- .await- .is_ok());+ assert!(+ strict_gate(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ &trigger_only_graph()+ )+ .await+ .is_ok()+ );// No trigger → structural failure surfaced by strict mode.let bad = json!({@@ -472,14 +474,16 @@ async fn referenced_child_compatibility_stops_at_saved_workflow_cycles() {.unwrap();let candidate = structurally_valid_graph(referenced_child_graph(&flow_a.id));- assert!(config_aware_engine_compatibility_errors(- &crate::core::runtime::DispatchCtx::ambient(),- &config,- serde_json::to_value(candidate).unwrap(),- )- .await- .unwrap()- .is_empty());+ assert!(+ config_aware_engine_compatibility_errors(+ &crate::core::runtime::DispatchCtx::ambient(),+ &config,+ serde_json::to_value(candidate).unwrap(),+ )+ .await+ .unwrap()+ .is_empty()+ );}// ── core-managed drafts (F5) ─────────────────────────────────────────────────diff --git a/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs b/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rsindex f41c526a93..1d2c506c10 100644--- a/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs+++ b/crates/openhuman-core/src/flows/ops_resume_checkpoint_tests.rs@@ -323,4 +323,3 @@ async fn flows_resume_allows_a_legacy_row_with_null_graph_hash() {.expect("a legacy row with no graph_hash must still resume (unknown treated as allow)");assert_eq!(resumed.value["pending_approvals"], json!([]));}-diff --git a/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rs b/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rsindex 784db1aa6c..2ed0e9975d 100644--- a/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rs+++ b/crates/openhuman-core/src/flows/ops_resume_compatibility_tests.rs@@ -1,5 +1,5 @@-use super::*;use super::resume_checkpoint_tests::update_parked_run_document_for_test;+use super::*;#[tokio::test]async fn flows_resume_marks_an_incompatible_legacy_checkpoint_failed() {@@ -167,4 +167,3 @@ async fn flows_resume_missing_flow_errors() {.expect_err("must error");assert!(err.contains("not found"));}-diff --git a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rsindex 7a946119ae..24bbeac9bf 100644--- a/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs+++ b/crates/openhuman-core/src/flows/ops_run_lifecycle_tests.rs@@ -3,17 +3,19 @@ use super::*;fn insert_parked_run(config: &Config, flow_id: &str, run_id: &str) {let now = Utc::now().to_rfc3339();store::insert_flow_run(config, run_id, flow_id, run_id, &now).unwrap();- assert!(store::finish_flow_run(- config,- run_id,- "pending_approval",- &now,- &[],- &["gate".into()],- None,- Some("parked-graph"),- )- .unwrap());+ assert!(+ store::finish_flow_run(+ config,+ run_id,+ "pending_approval",+ &now,+ &[],+ &["gate".into()],+ None,+ Some("parked-graph"),+ )+ .unwrap()+ );}#[tokio::test]diff --git a/crates/openhuman-core/src/flows/ops_tests.rs b/crates/openhuman-core/src/flows/ops_tests.rsindex c45fd87db2..0b880a5450 100644--- a/crates/openhuman-core/src/flows/ops_tests.rs+++ b/crates/openhuman-core/src/flows/ops_tests.rs@@ -342,7 +342,7 @@ fn graph(value: Value) -> WorkflowGraph {fn seed_app_session_for_gate_test(tmp: &TempDir) {use crate::security::credentials::{- AuthService, APP_SESSION_PROVIDER, DEFAULT_AUTH_PROFILE_NAME,+ APP_SESSION_PROVIDER, AuthService, DEFAULT_AUTH_PROFILE_NAME,};// `verify_session_active` reads from `config.config_path.parent()`, which// `test_config` sets to `tmp.path()` itself (distinct from@@ -365,7 +365,7 @@ fn seed_app_session_for_gate_test(tmp: &TempDir) {// so none of this touches a live Composio backend.use crate::integrations::composio::catalog::{- seed_live_catalog_cache, seed_probe_cache, ProbedOutputSample, ToolContract,+ ProbedOutputSample, ToolContract, seed_live_catalog_cache, seed_probe_cache,};fn seeded_slack_send_contract() -> ToolContract {diff --git a/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rs b/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rsindex 39f95c8e94..877a4c1ef9 100644--- a/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rs+++ b/crates/openhuman-core/src/flows/ops_tool_contract_and_wiring_warnings_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::integrations::composio::catalog::{seed_live_catalog_cache, ToolContract};+use crate::integrations::composio::catalog::{ToolContract, seed_live_catalog_cache};fn seeded_alias_contract() -> ToolContract {ToolContract {