fix(hub): E2E repairs of 066 to 084 and unclipped stream code boxes
Real bugs: the 084 limit bar wrapped at 390 px and dropped the hardware chart; the 066 footer rule shrank the mic below 44 px; the board's Running and Prune labels pushed the Tasks head onto two rows; a closed code box cut long commands off instead of scrolling. Resources reads disk use as df does (total = used + available) and gives every hardware kind its own tone. Stale specs follow 067, 070, 072 and 078 decisions. 🎯 Fix: 80 % 💥 Break: 8 % 💸 Tokens: - ⏱️ Velocity: - 🛡️ Security: 100 % 🏆 Score: 74 🚦 Gate: ⛔ fix 80 % < 90, break 8 % > 5 (E2E rerun after 085 to 094, operator word 2026-11-27) Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b0ee62dd0b
commit
ca97776b4d
18 files changed
+67
-29
No files matched your search
@@ -190,18 +190,21 @@ def parse_df(text: str) -> list[dict]:
|
|||||||
"""Returns:
|
"""Returns:
|
||||||
One {mount, used, total} in bytes per block device in the output of
|
One {mount, used, total} in bytes per block device in the output of
|
||||||
df -P -k, at the first mount df lists for it; loop devices and
|
df -P -k, at the first mount df lists for it; loop devices and
|
||||||
filesystems without a device are left out.
|
filesystems without a device are left out. total is used plus
|
||||||
|
available, the size normal writes can fill, so used / total is df's
|
||||||
|
Capacity; the 1K-blocks column also counts the blocks reserved for
|
||||||
|
root and would understate the fill level.
|
||||||
"""
|
"""
|
||||||
found, seen = [], set()
|
found, seen = [], set()
|
||||||
for line in text.splitlines()[1:]:
|
for line in text.splitlines()[1:]:
|
||||||
parts = line.split(None, 5)
|
parts = line.split(None, 5)
|
||||||
if len(parts) < 6 or not parts[0].startswith("/dev/") or parts[0].startswith("/dev/loop") or parts[0] in seen:
|
if len(parts) < 6 or not parts[0].startswith("/dev/") or parts[0].startswith("/dev/loop") or parts[0] in seen:
|
||||||
continue
|
continue
|
||||||
total, used = number(parts[1]), number(parts[2])
|
used, available = number(parts[2]), number(parts[3])
|
||||||
if total is None or used is None:
|
if used is None or available is None:
|
||||||
continue
|
continue
|
||||||
seen.add(parts[0])
|
seen.add(parts[0])
|
||||||
found.append({"mount": parts[5], "used": int(used) * KIB, "total": int(total) * KIB})
|
found.append({"mount": parts[5], "used": int(used) * KIB, "total": int(used + available) * KIB})
|
||||||
return found
|
return found
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
function pruneControls(stale) {
|
function pruneControls(stale) {
|
||||||
const pending = Prune.pending(state.jobs || [], pruneNow());
|
const pending = Prune.pending(state.jobs || [], pruneNow());
|
||||||
const open = h("button", {type: "button", class: "btn small", id: "kanban-prune-open", disabled: !stale && !pending, ...named("Prune", "Prune stale tasks: one passkey signs the list and a deadline; the agents can keep a task until then")}, icon("bi-scissors"), "Prune");
|
const open = h("button", {type: "button", class: "btn small icon-only", id: "kanban-prune-open", disabled: !stale && !pending, ...named("Prune", "Prune stale tasks: one passkey signs the list and a deadline; the agents can keep a task until then")}, icon("bi-scissors"));
|
||||||
open.addEventListener("click", openPrune);
|
open.addEventListener("click", openPrune);
|
||||||
if (!pending) {
|
if (!pending) {
|
||||||
return [open];
|
return [open];
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const RESOURCE = {left: 46, right: 10, wide: 50, top: 6, bottom: 6, axis: 18, poll: 5000, stale: 60, tones: 6, glyph: 6.5, shown: 100, lane: 13};
|
const RESOURCE = {left: 46, right: 10, wide: 50, top: 6, bottom: 6, axis: 18, poll: 5000, stale: 60, tones: 6, glyph: 6.5, shown: 100, lane: 13};
|
||||||
const RESOURCE_PANELS = [["hardware", "bi-cpu", "Hardware: disks, CPU, RAM, swap, GPU and VRAM"], ["tokens", "bi-coin", "Tokens per agent"], ["combined", "bi-layers", "Hardware, tokens and burnup"]];
|
const RESOURCE_PANELS = [["hardware", "bi-cpu", "Hardware: disks, CPU, RAM, swap, GPU and VRAM"], ["tokens", "bi-coin", "Tokens per agent"], ["combined", "bi-layers", "Hardware, tokens and burnup"]];
|
||||||
|
const HARDWARE_TONES = {shades: 3, host: {CPU: "res-cpu", RAM: "res-ram", Swap: "res-swap"}};
|
||||||
const RESOURCE_ZONES = {idle: "Idle: below 30 %", saturated: "Saturated: above 90 %"};
|
const RESOURCE_ZONES = {idle: "Idle: below 30 %", saturated: "Saturated: above 90 %"};
|
||||||
const RESOURCE_MARKS = {
|
const RESOURCE_MARKS = {
|
||||||
wait: ["#bi-hourglass-split", (mark) => `Idle waiting: ${mark.peak} jobs waited while CPU and RAM stayed under 50 %`, 0],
|
wait: ["#bi-hourglass-split", (mark) => `Idle waiting: ${mark.peak} jobs waited while CPU and RAM stayed under 50 %`, 0],
|
||||||
@@ -229,14 +230,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param samples - sampler rows.
|
||||||
|
* @returns the hardware lines, each with its tone: the disks in shades of one hue, CPU, RAM and swap each in its own
|
||||||
|
* hue, every GPU in shades of a further hue and its VRAM in yet another, so that no two kinds share a colour.
|
||||||
|
*/
|
||||||
function hardwareSeries(samples) {
|
function hardwareSeries(samples) {
|
||||||
const tones = new Map();
|
const shades = {disk: new Map(), util: new Map(), vram: new Map()};
|
||||||
return Resources.hardware(samples).map((line) => {
|
return Resources.hardware(samples).map((line) => {
|
||||||
if (!tones.has(line.name)) {
|
const shade = shades[line.kind];
|
||||||
tones.set(line.name, tones.size % RESOURCE.tones);
|
if (shade && !shade.has(line.name)) {
|
||||||
|
shade.set(line.name, shade.size % HARDWARE_TONES.shades);
|
||||||
}
|
}
|
||||||
|
const tone = shade ? `res-${line.kind}${shade.get(line.name)}` : HARDWARE_TONES.host[line.name];
|
||||||
const last = [...line.points].reverse().find(([, value]) => value !== null);
|
const last = [...line.points].reverse().find(([, value]) => value !== null);
|
||||||
return {...line, id: ViewStore.id(line.kind, line.name), label: `${resourceLabel(line)} ${dash(last === undefined ? null : last[1])} %`, tone: `res-c${tones.get(line.name)} k-${line.kind}`};
|
return {...line, id: ViewStore.id(line.kind, line.name), label: `${resourceLabel(line)} ${dash(last === undefined ? null : last[1])} %`, tone: `${tone} k-${line.kind}`};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,5 +26,5 @@
|
|||||||
kanban.running = !kanban.running;
|
kanban.running = !kanban.running;
|
||||||
taskView.sig = "";
|
taskView.sig = "";
|
||||||
drawTasks();
|
drawTasks();
|
||||||
}}}, icon("bi-activity"), "Running", counter(count));
|
}}}, icon("bi-activity"), counter(count));
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
.feedback-float { position: fixed; z-index: 40; padding: 2px; border-radius: 10px; background: var(--glass-card); box-shadow: var(--shadow); }
|
.feedback-float { position: fixed; z-index: 40; padding: 2px; border-radius: 10px; background: var(--glass-card); box-shadow: var(--shadow); }
|
||||||
.code-box { display: flex; flex-direction: column; min-width: 0; margin-top: 4px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
|
.code-box { display: flex; flex-direction: column; min-width: 0; margin-top: 4px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
|
||||||
.code-body { display: grid; gap: var(--sp-1); min-width: 0; padding: 7px 10px; }
|
.code-body { display: grid; gap: var(--sp-1); min-width: 0; padding: 7px 10px; }
|
||||||
.code-box[data-open="false"] > .code-body { max-height: 12lh; overflow: hidden; }
|
.code-box[data-open="false"] > .code-body { max-height: 12lh; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
|
||||||
.code-box[data-place="closed"] > .code-body { max-height: calc(1lh + 14px); }
|
.code-box[data-place="closed"] > .code-body { max-height: calc(1lh + 14px); }
|
||||||
.code-box[data-place="closed"] .command > .linkish { min-width: 0; max-width: 100%; overflow: hidden; }
|
.code-box[data-place="closed"] .command > .linkish { min-width: 0; max-width: 100%; overflow: hidden; }
|
||||||
.code-box[data-place="closed"] .command code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
.code-box[data-place="closed"] .command code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
|||||||
@@ -69,9 +69,12 @@ svg .res-icon.hung { fill: var(--violet); pointer-events: none; }
|
|||||||
svg .res-icon.asleep, svg .res-icon.unknown { fill: var(--muted); }
|
svg .res-icon.asleep, svg .res-icon.unknown { fill: var(--muted); }
|
||||||
svg .res-bar { fill: var(--c); }
|
svg .res-bar { fill: var(--c); }
|
||||||
svg .res-bar.faint { opacity: 0.35; }
|
svg .res-bar.faint { opacity: 0.35; }
|
||||||
.res-limits { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: var(--fs-xs); }
|
.res-panel.res-hardware { min-height: min-content; }
|
||||||
|
.res-panel.res-hardware > .res-plot { min-height: 48px; }
|
||||||
|
.res-limits { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; font-size: var(--fs-xs); }
|
||||||
|
.res-limits > * { flex: none; }
|
||||||
.res-limits .segmented button { padding: 2px 8px; font-size: var(--fs-xs); }
|
.res-limits .segmented button { padding: 2px 8px; font-size: var(--fs-xs); }
|
||||||
.limit-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
.res-limits > .limit-note { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
.limit-error { margin: 0; color: var(--bad); }
|
.limit-error { margin: 0; color: var(--bad); }
|
||||||
.limits-table { border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
|
.limits-table { border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
|
||||||
.limits-table th, .limits-table td { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
|
.limits-table th, .limits-table td { padding: 3px 6px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
|
||||||
@@ -92,5 +95,17 @@ svg .res-target text { fill: var(--muted); font-size: var(--fs-2xs); }
|
|||||||
.res-c3 { --c: var(--warn); }
|
.res-c3 { --c: var(--warn); }
|
||||||
.res-c4 { --c: var(--violet); }
|
.res-c4 { --c: var(--violet); }
|
||||||
.res-c5 { --c: var(--bad); }
|
.res-c5 { --c: var(--bad); }
|
||||||
|
.res-disk0 { --c: var(--ok); }
|
||||||
|
.res-disk1 { --c: color-mix(in srgb, var(--ok) 55%, var(--text)); }
|
||||||
|
.res-disk2 { --c: color-mix(in srgb, var(--ok) 55%, var(--panel)); }
|
||||||
|
.res-cpu { --c: var(--info); }
|
||||||
|
.res-ram { --c: var(--violet); }
|
||||||
|
.res-swap { --c: var(--warn); }
|
||||||
|
.res-util0 { --c: color-mix(in srgb, var(--bad) 50%, var(--violet)); }
|
||||||
|
.res-util1 { --c: color-mix(in srgb, color-mix(in srgb, var(--bad) 50%, var(--violet)) 55%, var(--text)); }
|
||||||
|
.res-util2 { --c: color-mix(in srgb, color-mix(in srgb, var(--bad) 50%, var(--violet)) 55%, var(--panel)); }
|
||||||
|
.res-vram0 { --c: var(--bad); }
|
||||||
|
.res-vram1 { --c: color-mix(in srgb, var(--bad) 55%, var(--text)); }
|
||||||
|
.res-vram2 { --c: color-mix(in srgb, var(--bad) 55%, var(--panel)); }
|
||||||
.res-burn.k-done { --c: var(--ok); }
|
.res-burn.k-done { --c: var(--ok); }
|
||||||
.res-burn.k-scope { --c: var(--text); }
|
.res-burn.k-scope { --c: var(--text); }
|
||||||
@@ -112,6 +112,7 @@ body.fit .spot-host { flex: none; }
|
|||||||
@container composer-foot (max-width: 480px) {
|
@container composer-foot (max-width: 480px) {
|
||||||
.composer .cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
.composer .cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
||||||
}
|
}
|
||||||
|
@media (max-width: 640px) { .composer .composer-foot :is(button, summary) { min-width: 44px; min-height: 44px; } }
|
||||||
@media (prefers-reduced-motion: reduce) { .composer .composer-foot .bi { animation: none; } }
|
@media (prefers-reduced-motion: reduce) { .composer .composer-foot .bi { animation: none; } }
|
||||||
[data-rec="busy"] > .bi { animation: presence-spin 1.2s linear infinite; }
|
[data-rec="busy"] > .bi { animation: presence-spin 1.2s linear infinite; }
|
||||||
@media (prefers-reduced-motion: reduce) { [data-rec="busy"] > .bi { animation: none; } }
|
@media (prefers-reduced-motion: reduce) { [data-rec="busy"] > .bi { animation: none; } }
|
||||||
|
|||||||
@@ -115,7 +115,11 @@ BULK = """(async () => {@HELPERS@@PLAN_HELPERS@
|
|||||||
found.toast = await fresh(shown, "Business value @VALUE@ for 2 tasks");
|
found.toast = await fresh(shown, "Business value @VALUE@ for 2 tasks");
|
||||||
found.asked = asked;
|
found.asked = asked;
|
||||||
found.posted = posted;
|
found.posted = posted;
|
||||||
found.after = [button.disabled, all("#main .task-row input.task-pick:checked").length];
|
const picked = () => [document.getElementById("bulk-value").disabled, all("#main .task-row input.task-pick:checked").length];
|
||||||
|
if (@SIGNS@) {
|
||||||
|
await until(() => JSON.stringify(picked()) === JSON.stringify([true, 0]), 8000);
|
||||||
|
}
|
||||||
|
found.after = picked();
|
||||||
Object.assign(found, fits());
|
Object.assign(found, fits());
|
||||||
all('#main [aria-label="Estimation"] button').find((entry) => entry.dataset.estimation === "none").click();
|
all('#main [aria-label="Estimation"] button').find((entry) => entry.dataset.estimation === "none").click();
|
||||||
found.reset = Boolean(await until(() => requestShown() === false, 8000));
|
found.reset = Boolean(await until(() => requestShown() === false, 8000));
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ class TestCommitTreeDiff(HubCase):
|
|||||||
repo, target = merge_repo(Path(work.name))
|
repo, target = merge_repo(Path(work.name))
|
||||||
tree = git(repo, "rev-parse", f"{target}^{{tree}}").strip()
|
tree = git(repo, "rev-parse", f"{target}^{{tree}}").strip()
|
||||||
self.parent = git(repo, "rev-parse", "main").strip()
|
self.parent = git(repo, "rev-parse", "main").strip()
|
||||||
|
with self.assertRaises(staged_diff.DiffError) as missing:
|
||||||
|
staged_diff.git(repo, ["cat-file", "-t", MISSING], None)
|
||||||
|
self.missing = str(missing.exception)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
self.write_council({
|
self.write_council({
|
||||||
"work/s1/claim.json": {"office": "work/s1", "session": "s1", "runtime": "claude", "name": "Skills", "since": iso(now - 86400), "beat": now, "work": "commit-tree"},
|
"work/s1/claim.json": {"office": "work/s1", "session": "s1", "runtime": "claude", "name": "Skills", "since": iso(now - 86400), "beat": now, "work": "commit-tree"},
|
||||||
@@ -120,7 +123,8 @@ class TestCommitTreeDiff(HubCase):
|
|||||||
with self.subTest(browser=browser, width=width, step="error"):
|
with self.subTest(browser=browser, width=width, step="error"):
|
||||||
self.assertNotIn("error", broken, broken)
|
self.assertNotIn("error", broken, broken)
|
||||||
self.assertEqual((broken["failed"], broken["files"], broken["none"], broken["wide"]), ("true", 0, "No diff to show.", False), broken)
|
self.assertEqual((broken["failed"], broken["files"], broken["none"], broken["wide"]), ("true", 0, "No diff to show.", False), broken)
|
||||||
self.assertIn(f"No commit-tree diff: git cat-file -t {MISSING} failed: fatal: Not a valid object name {MISSING}", broken["line"])
|
self.assertTrue(self.missing.startswith(f"git cat-file -t {MISSING} failed: fatal: "), self.missing)
|
||||||
|
self.assertIn(f"No commit-tree diff: {self.missing}", broken["line"])
|
||||||
|
|
||||||
def test_chromium_shows_the_commit_tree_diff_its_eye_toggle_and_the_git_error_line(self):
|
def test_chromium_shows_the_commit_tree_diff_its_eye_toggle_and_the_git_error_line(self):
|
||||||
data = self.drive(self.steps("chromium"), None)
|
data = self.drive(self.steps("chromium"), None)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ TOOLS = """(async () => {@HELPERS@
|
|||||||
return {error: text(document.getElementById("main"))};
|
return {error: text(document.getElementById("main"))};
|
||||||
}
|
}
|
||||||
const rows = () => all("#main .tool-row").map((node) => [node.closest("[data-list]").dataset.list, node.dataset.tool, node.dataset.on, node.hasAttribute("data-staged")]);
|
const rows = () => all("#main .tool-row").map((node) => [node.closest("[data-list]").dataset.list, node.dataset.tool, node.dataset.on, node.hasAttribute("data-staged")]);
|
||||||
const bar = () => document.querySelector("#main .apply-bar");
|
const bar = () => document.querySelector('#main .apply-bar[aria-label="Apply changes"]');
|
||||||
const found = {before: rows(), hidden: bar().hidden};
|
const found = {before: rows(), hidden: bar().hidden};
|
||||||
await flip("blender", true);
|
await flip("blender", true);
|
||||||
await flip("caveman@caveman", true);
|
await flip("caveman@caveman", true);
|
||||||
@@ -308,7 +308,7 @@ class TestFirewallE2E(HubCase):
|
|||||||
with self.subTest(width=width):
|
with self.subTest(width=width):
|
||||||
self.assertNotIn("error", shown, shown)
|
self.assertNotIn("error", shown, shown)
|
||||||
self.assertEqual((shown["title"], shown["subs"]), ("Controls", base.SUBS))
|
self.assertEqual((shown["title"], shown["subs"]), ("Controls", base.SUBS))
|
||||||
self.assertEqual(shown["tabs"], {"first": [["tools", "true", False], ["rules", "false", True], ["schedules", "false", True]], "picked": [["tools", "false", True], ["rules", "true", False], ["schedules", "false", True]]})
|
self.assertEqual(shown["tabs"], {"first": [["tools", "true", False], ["rules", "false", True], ["schedules", "false", True], ["queue", "false", True]], "picked": [["tools", "false", True], ["rules", "true", False], ["schedules", "false", True], ["queue", "false", True]]})
|
||||||
self.assertEqual(shown["collapsed"], [True] * 4)
|
self.assertEqual(shown["collapsed"], [True] * 4)
|
||||||
self.assertEqual(shown["sources"], [str(self.settings)])
|
self.assertEqual(shown["sources"], [str(self.settings)])
|
||||||
self.assertEqual(shown["folded"], {"expanded": ["false"], "rows": 0})
|
self.assertEqual(shown["folded"], {"expanded": ["false"], "rows": 0})
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ class TestHomeBookmarks(HubCase):
|
|||||||
loaded = next(results)
|
loaded = next(results)
|
||||||
self.assertTrue(loaded["drawn"], loaded)
|
self.assertTrue(loaded["drawn"], loaded)
|
||||||
found = next(results)
|
found = next(results)
|
||||||
self.assertEqual((found["charts"], found["stars"]), ([True] * 4, 0), found)
|
self.assertEqual((found["charts"], found["stars"]), ([True] * 5, 0), found)
|
||||||
self.assertEqual(found["tree"], [True], found)
|
self.assertEqual(found["tree"], [True], found)
|
||||||
self.assertTrue(found["rows"]["repo"] and all(found["rows"]["repo"]), found)
|
self.assertTrue(found["rows"]["repo"] and all(found["rows"]["repo"]), found)
|
||||||
self.assertTrue(found["rows"]["branch"] and all(found["rows"]["branch"]), found)
|
self.assertTrue(found["rows"]["branch"] and all(found["rows"]["branch"]), found)
|
||||||
|
|||||||
@@ -72,8 +72,10 @@ RADIO = """(async () => {@HELPERS@@SCAN@
|
|||||||
const mic = foot.querySelector(":scope > button.mic");
|
const mic = foot.querySelector(":scope > button.mic");
|
||||||
const idle = getComputedStyle(mic).backgroundColor;
|
const idle = getComputedStyle(mic).backgroundColor;
|
||||||
mic.setAttribute("aria-pressed", "true");
|
mic.setAttribute("aria-pressed", "true");
|
||||||
|
await sleep(300);
|
||||||
const recording = getComputedStyle(mic).backgroundColor;
|
const recording = getComputedStyle(mic).backgroundColor;
|
||||||
mic.setAttribute("aria-pressed", "false");
|
mic.setAttribute("aria-pressed", "false");
|
||||||
|
await sleep(300);
|
||||||
area.style.height = "260px";
|
area.style.height = "260px";
|
||||||
await sleep(100);
|
await sleep(100);
|
||||||
const after = scan().find((entry) => entry.id === area.id);
|
const after = scan().find((entry) => entry.id === area.id);
|
||||||
|
|||||||
@@ -106,14 +106,15 @@ USAGE = """(async () => {@HELPERS@@KIT@@BAR@
|
|||||||
pointer(document, "pointermove", rect.left + rect.width * 0.25, y);
|
pointer(document, "pointermove", rect.left + rect.width * 0.25, y);
|
||||||
pointer(document, "pointermove", rect.left + rect.width * 0.4, y);
|
pointer(document, "pointermove", rect.left + rect.width * 0.4, y);
|
||||||
pointer(document, "pointerup", rect.left + rect.width * 0.4, y);
|
pointer(document, "pointerup", rect.left + rect.width * 0.4, y);
|
||||||
const dragged = await settled(40);
|
const landed = await settled(40);
|
||||||
|
const dragged = landed ? read(landed) : null;
|
||||||
const stored = (await (await fetch("/api/accounts", {cache: "no-store"})).json()).calibrations;
|
const stored = (await (await fetch("/api/accounts", {cache: "no-store"})).json()).calibrations;
|
||||||
const before = {pressed: toggle().getAttribute("aria-pressed"), marks: marks()};
|
const before = {pressed: toggle().getAttribute("aria-pressed"), marks: marks()};
|
||||||
toggle().click();
|
toggle().click();
|
||||||
await until(() => toggle().getAttribute("aria-pressed") === "true" && marks().every(([, found]) => found.length === 1), 6000);
|
await until(() => toggle().getAttribute("aria-pressed") === "true" && marks().every(([, found]) => found.length === 1), 6000);
|
||||||
const on = {pressed: toggle().getAttribute("aria-pressed"), marks: marks()};
|
const on = {pressed: toggle().getAttribute("aria-pressed"), marks: marks()};
|
||||||
bar().scrollIntoView({block: "center", inline: "center"});
|
bar().scrollIntoView({block: "center", inline: "center"});
|
||||||
return {shown, right, paged, keyed: Boolean(keyed), kept, dragged: dragged ? read(dragged) : null, stored, before, on, page: wide(), violations: window.e2eViolations || null};
|
return {shown, right, paged, keyed: Boolean(keyed), kept, dragged, stored, before, on, page: wide(), violations: window.e2eViolations || null};
|
||||||
})()"""
|
})()"""
|
||||||
RELOAD = """(async () => {@HELPERS@@KIT@@BAR@
|
RELOAD = """(async () => {@HELPERS@@KIT@@BAR@
|
||||||
if (!(await until(() => bar() && toggle() && marks().every(([, found]) => found.length === 1), 15000))) {
|
if (!(await until(() => bar() && toggle() && marks().every(([, found]) => found.length === 1), 15000))) {
|
||||||
@@ -141,7 +142,7 @@ class TestResourcesAccounts(HubCase):
|
|||||||
sample = w4.TestWorkbenchResources.sample
|
sample = w4.TestWorkbenchResources.sample
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
HubCase.setUp(self)
|
||||||
OUT.mkdir(parents=True, exist_ok=True)
|
OUT.mkdir(parents=True, exist_ok=True)
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
self.start = now - now % 60 - w4.ROWS * 60
|
self.start = now - now % 60 - w4.ROWS * 60
|
||||||
|
|||||||
@@ -50,10 +50,10 @@ EXPLORE = """(async () => {@HELPERS@@READ@@KIT@
|
|||||||
rowOf("kvb-help").click();
|
rowOf("kvb-help").click();
|
||||||
const drilled = Boolean(await until(() => filters().join() === "skill" && keys().join() === "kvb-help", 6000));
|
const drilled = Boolean(await until(() => filters().join() === "skill" && keys().join() === "kvb-help", 6000));
|
||||||
choose(group(), "tool");
|
choose(group(), "tool");
|
||||||
const switched = Boolean(await until(() => keys().join() === "Bash,Read," && split(), 6000));
|
const regrouped = Boolean(await until(() => keys().join() === "Bash,Read," && split(), 6000));
|
||||||
const byTool = {group: group().value, keys: keys(), shares: cells("share"), split: split(), filters: filters()};
|
const byTool = {group: group().value, keys: keys(), shares: cells("share"), split: split(), filters: filters()};
|
||||||
box().scrollIntoView({block: "start"});
|
box().scrollIntoView({block: "start"});
|
||||||
return {bySkill, byCost, drilled, switched, byTool, page: wide(), violations: window.e2eViolations || null};
|
return {bySkill, byCost, drilled, switched: regrouped, byTool, page: wide(), violations: window.e2eViolations || null};
|
||||||
})()"""
|
})()"""
|
||||||
RESET = """(async () => {@HELPERS@@READ@@KIT@
|
RESET = """(async () => {@HELPERS@@READ@@KIT@
|
||||||
document.querySelector('#main .res-usage [data-filter="skill"]').click();
|
document.querySelector('#main .res-usage [data-filter="skill"]').click();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ PAGE = """(async () => {@HELPERS@
|
|||||||
}
|
}
|
||||||
window.e2eSameDocument = true;
|
window.e2eSameDocument = true;
|
||||||
const fold = (id) => document.querySelector(`#main details[data-fold="${id}"]`);
|
const fold = (id) => document.querySelector(`#main details[data-fold="${id}"]`);
|
||||||
const shown = (node) => Boolean(node && node.getClientRects().length);
|
const shown = (node) => Boolean(node && node.checkVisibility());
|
||||||
const visible = (id) => all("li.hub-rule", fold(id)).filter(shown).length;
|
const visible = (id) => all("li.hub-rule", fold(id)).filter(shown).length;
|
||||||
const rowOf = (pattern) => all("#main li.hub-rule").find((node) => text(node.querySelector(".hub-rule-pattern")) === pattern);
|
const rowOf = (pattern) => all("#main li.hub-rule").find((node) => text(node.querySelector(".hub-rule-pattern")) === pattern);
|
||||||
const chipOf = (row) => row.querySelector("[data-expiry]");
|
const chipOf = (row) => row.querySelector("[data-expiry]");
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ HOME = """(async () => {@HELPERS@@SHAPE@
|
|||||||
}
|
}
|
||||||
await sleep(40);
|
await sleep(40);
|
||||||
const body = tile.querySelector(".home-body").getBoundingClientRect();
|
const body = tile.querySelector(".home-body").getBoundingClientRect();
|
||||||
const out = [".ptt-split", ".mayday-toggle"].filter((selector) => {
|
const out = [".ptt-split > :first-child", ".ptt-split .ptt-more", ".mayday-toggle"].filter((selector) => {
|
||||||
const edge = tile.querySelector(selector).getBoundingClientRect();
|
const edge = tile.querySelector(selector).getBoundingClientRect();
|
||||||
return !(edge.width > 0 && edge.left >= body.left - 0.5 && edge.right <= body.right + 0.5 && edge.top >= body.top - 0.5 && edge.bottom <= body.bottom + 0.5);
|
return !(edge.width > 0 && edge.left >= body.left - 0.5 && edge.right <= body.right + 0.5 && edge.top >= body.top - 0.5 && edge.bottom <= body.bottom + 0.5);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ class TestWorkbenchResources(HubCase):
|
|||||||
self.assertEqual(found["unknown"], [[self.start + UNREAD[0] * 60, self.start + UNREAD[1] * 60]])
|
self.assertEqual(found["unknown"], [[self.start + UNREAD[0] * 60, self.start + UNREAD[1] * 60]])
|
||||||
self.assertEqual((found["agents"], found["bottoms"], found["stacked"]), (["Skills", "Stage"], ["Skills"], True))
|
self.assertEqual((found["agents"], found["bottoms"], found["stacked"]), (["Skills", "Stage"], ["Skills"], True))
|
||||||
self.assertEqual(found["legend"], ["CPU 60 %", "RAM 55 %", "Swap 5 %"])
|
self.assertEqual(found["legend"], ["CPU 60 %", "RAM 55 %", "Swap 5 %"])
|
||||||
self.assertEqual(found["labels"], {"tab": ["Resources (key 6)", "Resources"], "reload": ["Reload: read the sampler files and the accounts again", "Reload"], "titles": [[name, name] for name in PANELS.values()]})
|
self.assertEqual(found["labels"], {"tab": ["Resources (key 6)", "Resources"], "reload": ["Reload: read the sampler files, the accounts and the usage again", "Reload"], "titles": [[name, name] for name in PANELS.values()]})
|
||||||
self.assertEqual((found["unlabelled"], found["plots"]), (0, [True] * 2))
|
self.assertEqual((found["unlabelled"], found["plots"]), (0, [True] * 2))
|
||||||
self.assertEqual((found["tall"], found["wide"]), (False, False), "the page scrolls")
|
self.assertEqual((found["tall"], found["wide"]), (False, False), "the page scrolls")
|
||||||
self.assertEqual(quiet(found["violations"]), [])
|
self.assertEqual(quiet(found["violations"]), [])
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ tmpfs 8000000 1000 7999000 1% /dev/shm
|
|||||||
overlay 976762584 512000000 460000000 53% /var/lib/docker/overlay2/x/merged
|
overlay 976762584 512000000 460000000 53% /var/lib/docker/overlay2/x/merged
|
||||||
"""
|
"""
|
||||||
DISKS = [
|
DISKS = [
|
||||||
{"mount": "/", "used": 512000000 * 1024, "total": 976762584 * 1024},
|
{"mount": "/", "used": 512000000 * 1024, "total": (512000000 + 460000000) * 1024},
|
||||||
{"mount": "/boot/efi", "used": 12000 * 1024, "total": 523248 * 1024},
|
{"mount": "/boot/efi", "used": 12000 * 1024, "total": (12000 + 511248) * 1024},
|
||||||
{"mount": "/mnt/Backup Disk", "used": 100000000 * 1024, "total": 1953514584 * 1024},
|
{"mount": "/mnt/Backup Disk", "used": 100000000 * 1024, "total": (100000000 + 1853514584) * 1024},
|
||||||
]
|
]
|
||||||
MEMINFO = """MemTotal: 32000000 kB
|
MEMINFO = """MemTotal: 32000000 kB
|
||||||
MemFree: 2000000 kB
|
MemFree: 2000000 kB
|
||||||
|
|||||||
Reference in new issue
Block a user