The review ran 27 mutants and 6 survived. Each fix below was then mutation-tested against the
shipped source, with rc captured on its own line -- a piped `| tail` reports the tail's status and
would have hidden every one of these.
download.test.js 31 -> 34 checks:
The assertion at :64 could not fail. `ok(page.indexOf('<span class="cap">Requests</span>') < iBtn)`
compares against indexOf, which returns -1 when the caption is absent, and -1 < anything is always
true. Renaming the caption survived both suites. Now the index is captured and required to exist
before the order is compared.
The stubs recorded counts, not sequence: click() incremented a counter, appendChild pushed to a
separate array. So click-before-appendChild survived -- and Firefox ignores a click on an anchor
that is not yet in the DOM, so that ordering is a silently dead button in a real browser. One
shared seq[] log now makes the order assertable, and the mutant is caught by the new assertion
itself ("the anchor is in the DOM BEFORE it is clicked: ["click","append","remove"]"), not by a
crash. My first attempt at that mutant targeted el.body, which does not exist, and failed with a
TypeError -- proving only that the mutant was malformed, so I rebuilt it against the real line.
history.test.js 29 -> 37 checks:
The formatters were re-typed. The suite passed its own `(v) => v + " ms"` into the shipped
renderer, then asserted "value and unit are one string" against the unit the stub had
manufactured -- testing the fake, not the page. tps/cnt3/dur are now sliced from the shipped
source (DASH..dur is self-contained) and the guard compares against what the real dur() renders.
Presence assertions became value assertions. "last 20" appearing in the string survived
slice(-20) -> slice(-100), because the label was still there while the figure silently became the
last 100 -- a wrong number on a performance dashboard. Each figure is now compared to a mean
computed independently of the shipped group(). The fixture also had to change: the old cycling
values made mean(all) equal mean(last 20) by coincidence, so no window mutation could show up in
the output. Distinct values per row fix that.
Threshold fixtures at 7, 12 and 24 rows. 12 is the discriminating count -- it kills a threshold
lowered to <=12 as well as one raised.
The two .hsep padding regexes are unified. One was loose, one strict, and they disagreed about
whitespace: a reformat from `padding:0 9px` to `padding: 0 9px` passed the loose test and then
CRASHED the suite on `null[1]`. One regex, one match, checked before use.
Verified: slice(-100) caught (2 failures), threshold >=12 caught, ttft median->mean caught
("1.65 s" want "1.70 s"), padding reformat now passes cleanly. Full suite: 27/35/37/34 JS,
241/8 and 62646/184 C++.
Authored at: Memoria Qwen 3.8 Flash-Next 125B MoE (xhigh) via Open WebUI
Dashboard page tests
The dashboard is one C++ string: core/server/dashboard.cpp embeds the whole page,
so its JavaScript has no file of its own to test. These harnesses extract the page
from the translation unit (page.js) and execute the shipped functions, sliced
by line range, against mocked DOM. A retyped copy would test the copy, not the bytes
that ship — and a sliced function that is defined but never called proves nothing,
which has already happened once here.
node tests/js/poll_spark.test.js
node tests/js/extremes.test.js
node tests/js/history.test.js
node tests/js/download.test.js
What each one covers
| file | the shipped code it drives |
|---|---|
poll_spark.test.js |
the cadence fields, the sparkline |
extremes.test.js |
noteSample, triple, acceptTriple, resetWindows, newEngineRun |
history.test.js |
the history summary line: how it groups, and how it wraps |
download.test.js |
the Requests-header JSON export: its markup and its handler |
Each asserts structure, not just text. history.test.js inspects the DOM the page builds and the
CSS it ships, because the rules it guards -- a category wraps whole, the category break is a dot
and the break within one is a pipe -- are not properties of any string the code builds.
download.test.js invokes the click handler against stubs and checks it really builds a file,
names it, clicks it and releases the blob URL: a button that looks clickable and does nothing is
the failure it exists to catch.
The render check (manual, needs Chrome)
render_align.js is not a unit test and cannot be: it answers whether the download glyph is
level with the caption by loading the page in headless Chrome, screenshotting the header at 4x,
and comparing the lowest inked pixel row of each. It needs puppeteer and a Chrome binary, which
are deliberately not repo dependencies:
npm i puppeteer && npx puppeteer browsers install chrome
node tests/js/render_align.js http://127.0.0.1:8800/
Exits nonzero when the two bottoms land on different device rows. Run it after touching glyph or header geometry. Three claims about alignment and spacing went through this branch on the strength of reading the CSS and the SVG viewBox, and all three were wrong -- collapsed whitespace made a "wide" separator zero pixels wide, and an SVG whose box is flush with the baseline still floats, because the baseline sits above the box bottom. None of that is visible in the source. Measure the rendered page.
Why these are not in ctest
They need node, which is not a build dependency of this project and will not be
present on a contributor's box or in the ROCm build image. Wiring them into ctest
would turn a missing optional tool into a red build, so they stay opt-in and are run
by hand when the page changes. dashboard_test covers the C++ side only.
History
Both files came out of the 2026-11-01 dashboard review. Commit 9cc237f claimed
"18 checks execute the shipped noteSample, triple, acceptTriple, resetWindows and
newEngineRun" while the harness lived only in /tmp — true when written, not
reproducible by anyone else, which an independent review correctly rejected. They are
in the tree so that claim can be re-run. history.test.js and download.test.js came from the
dashboard work that followed, on the same rule: a check that lives in /tmp is a claim about the
author's machine.