tests: the rnstatus polls show what rnstatus-rs printed when it is not JSON

This commit is contained in:
DeFiDude committed 2026-11-15 11:12:15 -07:00
1 parent 42888c7ac5
commit 2162c48b8f
2 files changed
+20 -4

No files matched your search

@@ -187,8 +187,16 @@ fn poll_shared_server(
last_status = output.status.code();
(last_stdout, last_stderr) = output_text(&output);
if output.status.success() {
let value: serde_json::Value =
serde_json::from_slice(&output.stdout).expect("rnstatus-rs JSON output");
let value: serde_json::Value = match serde_json::from_slice(&output.stdout) {
Ok(value) => value,
Err(error) => {
return Err(format!(
"rnstatus-rs succeeded without printing JSON ({error})\n\
--- rnstatus stdout ---\n{last_stdout}\n\
--- rnstatus stderr ---\n{last_stderr}"
));
}
};
let ready = value
.get("interfaces")
.and_then(|v| v.as_array())
+10 -2
View File
@@ -171,8 +171,16 @@ where
(last_stdout, last_stderr) = output_text(&output);
if output.status.success() {
let value: serde_json::Value =
serde_json::from_slice(&output.stdout).expect("rnstatus-rs JSON output");
let value: serde_json::Value = match serde_json::from_slice(&output.stdout) {
Ok(value) => value,
Err(error) => {
return Err(format!(
"rnstatus-rs succeeded without printing JSON ({error})\n\
--- rnstatus stdout ---\n{last_stdout}\n\
--- rnstatus stderr ---\n{last_stderr}"
));
}
};
let interfaces = value
.get("interfaces")
.and_then(|v| v.as_array())