Skip to content

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

test(config): register components migration tests and fix module path

Steven Enamakel97bf12a7ec7e
diff --git a/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs b/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs
index 83fe766812..d70b6fed84 100644
--- a/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_components_migration_tests.rs
@@ -8,7 +8,7 @@ fn parse(raw: &str) -> Config {
fn migrated(raw: &str, tinymemes: Option<&str>) -> Config {
let mut c = parse(raw);
- super::migrate::migrate_components_with(&mut c, raw, tinymemes);
+ crate::config::schema::load::migrate::migrate_components_with(&mut c, raw, tinymemes);
c
}
@@ -45,10 +45,19 @@ fn hosting_enabled_false_alone_maps_to_components_hosting() {
#[test]
fn enabled_or_absent_legacy_flags_change_nothing() {
- let c = migrated("[hosting]\nenabled = true\n[mcp_client]\nenabled = true\n", Some("on"));
- assert_eq!(c.components, crate::config::schema::ComponentsConfig::default());
+ let c = migrated(
+ "[hosting]\nenabled = true\n[mcp_client]\nenabled = true\n",
+ Some("on"),
+ );
+ assert_eq!(
+ c.components,
+ crate::config::schema::ComponentsConfig::default()
+ );
let c = migrated("", None);
- assert_eq!(c.components, crate::config::schema::ComponentsConfig::default());
+ assert_eq!(
+ c.components,
+ crate::config::schema::ComponentsConfig::default()
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
index 0449bbe648..cd8fcc3cca 100644
--- a/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_env_overlay_tests.rs
@@ -556,8 +556,14 @@ fn env_overlay_component_switches_apply_and_ignore_garbage() {
cfg.apply_env_overlay_with(&env);
assert!(!cfg.components.flows);
assert!(!cfg.components.voice);
- assert!(cfg.components.mcp, "invalid value must leave the switch alone");
- assert!(!cfg.components.hosting, "unset env must not touch the config");
+ assert!(
+ cfg.components.mcp,
+ "invalid value must leave the switch alone"
+ );
+ assert!(
+ !cfg.components.hosting,
+ "unset env must not touch the config"
+ );
let env = HashMapEnv::new().with("OPENHUMAN_COMPONENT_HOSTING", "1");
cfg.apply_env_overlay_with(&env);
diff --git a/crates/openhuman-core/src/config/schema/load_tests.rs b/crates/openhuman-core/src/config/schema/load_tests.rs
index 385d3859c9..9fd7bdf009 100644
--- a/crates/openhuman-core/src/config/schema/load_tests.rs
+++ b/crates/openhuman-core/src/config/schema/load_tests.rs
@@ -104,6 +104,8 @@ async fn write_binary(path: &std::path::Path, bytes: &[u8]) {
mod active_user_and_dirs_tests;
#[path = "load_backup_tests.rs"]
mod backup_tests;
+#[path = "load_components_migration_tests.rs"]
+mod components_migration_tests;
#[path = "load_corruption_recovery_tests.rs"]
mod corruption_recovery_tests;
#[path = "load_env_overlay_context_tests.rs"]