GUI round 11: fix headless self-test after Status dropped from default columns

Round 11 #12 removed the Status column from the default view, but the runtime
self-test (CI's "Headless UI self-test", separate from cargo test) read each
miner's status from the displayed Status cell -- now absent -- so three status
spot-checks failed and the self-test binary exited non-zero, failing CI. Status
is a model property, so the checks now read it straight from the row
(status_of(row) = rows[view_idx[row]].status()) instead of a displayed cell.
Self-test passes (exit 0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8h447BPyJR4fioYZvQ9bh
This commit is contained in:
2026-09-18 17:42:53 -06:00
co-authored by Claude Opus 4.8
parent 6b4961d7bc
commit 5399f9fc49
+11 -8
View File
@@ -2904,7 +2904,6 @@ impl App {
// 4. Independent spot-checks by IP against the known hardware output.
let ip_col = cols.iter().position(|c| *c == Column::Ip);
let status_col = cols.iter().position(|c| *c == Column::Status);
let hr_col = cols.iter().position(|c| *c == Column::Hashrate);
let find = |ip: &str| -> Option<usize> {
self.view_idx.iter().position(|&ri| self.rows[ri].ip == ip)
@@ -2917,6 +2916,10 @@ impl App {
None => String::new(),
}
};
// Status is a model property; the Status column is not in the default
// view (round 11 #12), so verify it straight from the row rather than a
// displayed cell.
let status_of = |row: usize| -> &'static str { self.rows[self.view_idx[row]].status() };
// Icon columns (round 11 #10/#13): the store carries shape sentinels
// (dots / padlock), not text -- verify they are present.
let boards_col = cols.iter().position(|c| *c == Column::Hashboards);
@@ -2931,9 +2934,9 @@ impl App {
check("Access column renders a closed-padlock sentinel for a locked miner",
raw.contains('\u{0002}'), format!("cell={raw:?}"));
}
if let (Some(row), Some(_)) = (find("10.255.1.149"), status_col) {
check("S21 Pro (.149) is slow", cell(row, status_col) == "slow",
format!("status=\"{}\"", cell(row, status_col)));
if let Some(row) = find("10.255.1.149") {
check("S21 Pro (.149) is slow", status_of(row) == "slow",
format!("status=\"{}\"", status_of(row)));
check("S21 Pro (.149) hashrate == 60.0T/200T",
cell(row, hr_col) == "60.0T/200T",
format!("hashrate=\"{}\"", cell(row, hr_col)));
@@ -2941,16 +2944,16 @@ impl App {
check("S21 Pro (.149) present", false, "row not found".into());
}
if let Some(row) = find("10.255.1.112") {
check("S17 (.112) is not hashing", cell(row, status_col) == "not hashing",
format!("status=\"{}\"", cell(row, status_col)));
check("S17 (.112) is not hashing", status_of(row) == "not hashing",
format!("status=\"{}\"", status_of(row)));
check("S17 (.112) blank hashrate", cell(row, hr_col).is_empty(),
format!("hashrate=\"{}\"", cell(row, hr_col)));
} else {
check("S17 (.112) present", false, "row not found".into());
}
if let Some(row) = find("10.255.1.115") {
check("WardenOS-dev (.115) is paused", cell(row, status_col) == "paused",
format!("status=\"{}\"", cell(row, status_col)));
check("WardenOS-dev (.115) is paused", status_of(row) == "paused",
format!("status=\"{}\"", status_of(row)));
} else {
check("WardenOS-dev (.115) present", false, "row not found".into());
}