mirror of
https://github.com/instructkr/claw-code.git
synced 2026-11-07 09:37:54 +01:00
test: make sandbox status check environment-aware
The /sandbox status can be 'ok' (with namespace isolation) or 'warn' (in restricted environments like CI without unshare support). Update the test to accept either value rather than hard-coding an expectation.
This commit is contained in:
1 parent
c4ce758d5e
commit
0e54dec1c9
1 file changed
+13
-4
@@ -470,10 +470,19 @@ fn direct_resume_safe_slash_commands_route_to_local_json_actions_831() {
|
||||
.unwrap_or_else(|_| panic!("{command} must emit JSON (#831), got: {stdout:?}"));
|
||||
|
||||
assert_eq!(parsed["kind"], expected_kind, "{command} kind: {parsed}");
|
||||
assert_eq!(
|
||||
parsed["status"], expected_status,
|
||||
"{command} status: {parsed}"
|
||||
);
|
||||
// /sandbox status varies by environment: "ok" when namespace isolation is available,
|
||||
// "warn" when running in restricted environments (e.g., CI without unshare support)
|
||||
if command == "/sandbox" {
|
||||
assert!(
|
||||
parsed["status"] == "ok" || parsed["status"] == "warn",
|
||||
"{command} status should be 'ok' or 'warn' but got: {parsed}"
|
||||
);
|
||||
} else {
|
||||
assert_eq!(
|
||||
parsed["status"], expected_status,
|
||||
"{command} status: {parsed}"
|
||||
);
|
||||
}
|
||||
assert_ne!(
|
||||
parsed["error_kind"], "interactive_only",
|
||||
"{command} must not emit interactive_only (#831): {parsed}"
|
||||
|
||||
Reference in new issue
Block a user