Skip to content

Commit 3a4d4f9

Browse files
authored
test(mxc): parse OpenClaw config schema portably (#3536)
Signed-off-by: Prekshi Vyas <prekshivyas@nvidia.com> (cherry picked from commit 3a0efc2) # Conflicts: # crates/openshell-driver-mxc/Cargo.toml
1 parent 80b35db commit 3a4d4f9

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

‎crates/openshell-driver-mxc/tests/openclaw_appcontainer_compat.rs‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,21 @@ fn runner_uses_lifecycle_readiness_and_preserves_failure_diagnostics() {
100100

101101
#[test]
102102
fn openclaw_gateway_configs_declare_the_current_schema() {
103-
for config in [
104-
PROCESS_CONTAINER_CONFIG,
105-
ISOLATION_CONFIG,
106-
LOCAL_NETWORK_CONFIG,
103+
for (name, config) in [
104+
("process-container", PROCESS_CONTAINER_CONFIG),
105+
("isolation", ISOLATION_CONFIG),
106+
("local-network", LOCAL_NETWORK_CONFIG),
107107
] {
108-
assert!(config.contains("[openshell]\nversion = 2"));
108+
let config = config
109+
.parse::<toml::Value>()
110+
.unwrap_or_else(|error| panic!("{name} config must be valid TOML: {error}"));
111+
assert_eq!(
112+
config
113+
.get("openshell")
114+
.and_then(|openshell| openshell.get("version"))
115+
.and_then(toml::Value::as_integer),
116+
Some(2),
117+
"{name} config must declare the current OpenShell schema",
118+
);
109119
}
110120
}

0 commit comments

Comments
 (0)