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
fix: correct test support module visibility and import paths
Steven Enamakel312bf16a29d6
diff --git a/crates/openhuman-core/src/integrations/test_support_backend.rs b/crates/openhuman-core/src/integrations/test_support_backend.rsindex 7c3bc9068b..3ee3d623f7 100644--- a/crates/openhuman-core/src/integrations/test_support_backend.rs+++ b/crates/openhuman-core/src/integrations/test_support_backend.rs@@ -736,7 +736,3 @@ pub async fn spawn_fake_integration_backend() -> FakeIntegrationBackend {state,}}--#[cfg(test)]-#[path = "test_support_tests.rs"]-mod tests;diff --git a/crates/openhuman-core/src/integrations/test_support_tests.rs b/crates/openhuman-core/src/integrations/test_support_tests.rsdeleted file mode 100644index 3c0ca83b06..0000000000--- a/crates/openhuman-core/src/integrations/test_support_tests.rs+++ /dev/null@@ -1,188 +0,0 @@-use super::*;--async fn get_json(client: &reqwest::Client, url: String) -> Value {- client- .get(url)- .send()- .await- .expect("GET request")- .json::<Value>()- .await- .expect("GET json body")-}--async fn post_json(client: &reqwest::Client, url: String, body: Value) -> Value {- client- .post(url)- .json(&body)- .send()- .await- .expect("POST request")- .json::<Value>()- .await- .expect("POST json body")-}--#[test]-fn as_string_array_filters_non_strings_and_missing_keys() {- let value = json!({- "searchQueries": ["alpha", 42, null, "beta"]- });- assert_eq!(- as_string_array(&value, "searchQueries"),- vec!["alpha".to_string(), "beta".to_string()]- );- assert!(as_string_array(&value, "missing").is_empty());-}--#[tokio::test]-async fn fake_backend_records_requests_and_applies_route_defaults() {- let backend = spawn_fake_integration_backend().await;- let client = reqwest::Client::new();-- let results = get_json(- &client,- format!(- "{}/agent-integrations/apify/runs/run-123/results",- backend.base_url- ),- )- .await;- assert_eq!(results["data"]["items"].as_array().unwrap().len(), 3);- assert_eq!(results["data"]["total"], json!(8));-- let twilio = post_json(- &client,- format!("{}/agent-integrations/twilio/call", backend.base_url),- json!({}),- )- .await;- assert_eq!(twilio["data"]["callSid"], json!("CA0000"));-- let requests = backend.requests();- assert_eq!(requests.len(), 2);- assert_eq!(- requests[0].path,- "/agent-integrations/apify/runs/run-123/results?limit=3&offset=0"- );- assert_eq!(requests[1].body, json!({}));-}--#[tokio::test]-async fn fake_backend_exercises_optional_and_fallback_response_paths() {- let backend = spawn_fake_integration_backend().await;- let client = reqwest::Client::new();-- let apify = post_json(- &client,- format!("{}/agent-integrations/apify/run", backend.base_url),- json!({- "actorId": "demo/actor",- "input": { "hello": "world" },- "sync": false- }),- )- .await;- assert_eq!(apify["data"]["status"], json!("RUNNING"));- assert_eq!(apify["data"]["datasetId"], json!("dataset-demo-actor"));-- let extract = post_json(- &client,- format!("{}/agent-integrations/parallel/extract", backend.base_url),- json!({- "urls": ["https://example.com/a"]- }),- )- .await;- assert_eq!(extract["data"]["results"][0]["full_content"], Value::Null);- assert_eq!(- extract["data"]["results"][0]["excerpts"][0],- json!("Focused on ")- );-- let options = post_json(- &client,- format!(- "{}/agent-integrations/financial-apis/options",- backend.base_url- ),- json!({- "symbol": "MSFT"- }),- )- .await;- assert_eq!(options["data"]["symbol"], json!("MSFT"));- assert_eq!(options["data"]["contracts"][0]["delta"], Value::Null);-- let search = post_json(- &client,- format!("{}/agent-integrations/parallel/search", backend.base_url),- json!({- "objective": "fallback objective"- }),- )- .await;- assert_eq!(search["data"]["searchId"], json!("search-0"));- assert_eq!(search["data"]["results"], json!([]));-- let tinyfish = post_json(- &client,- format!("{}/agent-integrations/tinyfish/agent/run", backend.base_url),- json!({- "url": "https://example.com",- "goal": "Return JSON"- }),- )- .await;- assert_eq!(tinyfish["data"]["status"], json!("COMPLETED"));- assert_eq!(tinyfish["data"]["result"]["ok"], json!(true));-}--#[tokio::test]-async fn fake_backend_caps_google_results_and_echoes_dynamic_inputs() {- let backend = spawn_fake_integration_backend().await;- let client = reqwest::Client::new();-- let places = post_json(- &client,- format!(- "{}/agent-integrations/google-places/search",- backend.base_url- ),- json!({- "query": "pizza",- "maxResults": 9- }),- )- .await;- assert_eq!(places["data"]["results"].as_array().unwrap().len(), 3);- assert_eq!(- places["data"]["results"][2]["name"],- json!("pizza Result 3")- );-- let commodity = post_json(- &client,- format!(- "{}/agent-integrations/financial-apis/commodity",- backend.base_url- ),- json!({- "commodity": "BRENT"- }),- )- .await;- assert_eq!(commodity["data"]["series"]["interval"], json!("daily"));-- let exchange = post_json(- &client,- format!(- "{}/agent-integrations/financial-apis/exchange-rate",- backend.base_url- ),- json!({}),- )- .await;- assert_eq!(exchange["data"]["rate"]["fromCurrency"], json!("BTC"));- assert_eq!(exchange["data"]["rate"]["toCurrency"], json!("USD"));-}diff --git a/crates/openhuman-core/src/web3/wallet/test_support.rs b/crates/openhuman-core/src/web3/wallet/test_support.rsindex 9b67ae1b25..b71a628b67 100644--- a/crates/openhuman-core/src/web3/wallet/test_support.rs+++ b/crates/openhuman-core/src/web3/wallet/test_support.rs@@ -178,7 +178,3 @@ pub(crate) async fn setup_wallet_in(temp: &TempDir) -> Result<WorkspaceEnvGuard,.await?;Ok(workspace_guard)}--#[cfg(test)]-#[path = "test_support_tests.rs"]-mod tests;diff --git a/crates/openhuman-core/src/web3/wallet/test_support_tests.rs b/crates/openhuman-core/src/web3/wallet/test_support_tests.rsdeleted file mode 100644index a0fb3e96bb..0000000000--- a/crates/openhuman-core/src/web3/wallet/test_support_tests.rs+++ /dev/null@@ -1,34 +0,0 @@-use super::*;--#[tokio::test]-async fn workspace_env_guard_restores_workspace_env_when_dropped() {- let env_lock = TEST_ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());- let previous = std::env::var_os("OPENHUMAN_WORKSPACE");- std::env::set_var("OPENHUMAN_WORKSPACE", "/tmp/openhuman-existing-workspace");-- let temp = TempDir::new().expect("temp dir");- let prev = std::env::var_os("OPENHUMAN_WORKSPACE");- std::env::set_var("OPENHUMAN_WORKSPACE", temp.path());- let workspace_guard = WorkspaceEnvGuard {- prev,- _env_lock: env_lock,- };- assert_eq!(- std::env::var_os("OPENHUMAN_WORKSPACE"),- Some(temp.path().as_os_str().to_os_string())- );-- drop(workspace_guard);- let _cleanup_lock = TEST_ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner());- assert_eq!(- std::env::var_os("OPENHUMAN_WORKSPACE"),- Some(std::ffi::OsString::from(- "/tmp/openhuman-existing-workspace"- ))- );-- match previous {- Some(value) => std::env::set_var("OPENHUMAN_WORKSPACE", value),- None => std::env::remove_var("OPENHUMAN_WORKSPACE"),- }-}