Skip to content

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

test(config): add hosted cloud provider registration for tests

Steven Enamakel3a040da50c05
diff --git a/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs b/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
index f8e78978c6..e09b12796a 100644
--- a/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
+++ b/crates/openhuman-core/src/config/ops/primary_cloud_tests.rs
@@ -1,6 +1,14 @@
use super::*;
use crate::config::schema::cloud_providers::{AuthStyle, CloudProviderCreds};
+use std::sync::Arc;
+
+fn register_test_hosted_policy() {
+ crate::config::schema::cloud_providers::register_hosted_cloud_provider_policy(
+ Arc::new(|slug| slug == "openhuman"),
+ Arc::new(|style| style == AuthStyle::OpenhumanJwt),
+ );
+}
fn provider(id: &str, slug: &str, endpoint: &str, auth_style: AuthStyle) -> CloudProviderCreds {
CloudProviderCreds {
@@ -15,6 +23,7 @@ fn provider(id: &str, slug: &str, endpoint: &str, auth_style: AuthStyle) -> Clou
#[test]
fn explicit_managed_primary_yields_matching_legacy_custom_provider() {
+ register_test_hosted_policy();
let mut config = Config::default();
config.cloud_providers = vec![
provider(
@@ -41,6 +50,7 @@ fn explicit_managed_primary_yields_matching_legacy_custom_provider() {
#[test]
fn explicit_managed_primary_fails_closed_for_unmatched_custom_intent() {
+ register_test_hosted_policy();
let mut config = Config::default();
config.cloud_providers = vec![provider(
"managed",