ci: run the web UI DOM test suites; fix two stale suites (#660)

A new "Web UI JS tests" job installs jsdom, starts the web interface in
emulator mode and runs test/js/run_all.js with REQUIRE_DOM=1, which makes a
DOM suite that can't run a failure rather than a silent skip. (The unit
suites were already covered through pytest.)

Two suites failed against main when run for real:
- test_tools_sections rendered the Tools partial without LEDEscape, which
  base.html's app-early.js defines; it now installs it in beforeParse, and
  supplies two sample Starlark apps (one id with a quote) when the server
  has none, instead of assuming a device with apps and Pixlet.
- test_store_dom assumed the live registry had at most 48 plugins; it now
  checks pagination whichever side of 48 it is.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-28 15:01:08 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 989eae9405
commit e6e0a16140
6 changed files with 84 additions and 6 deletions
+7 -1
View File
@@ -4,6 +4,8 @@
// node run_all.js unit suites, plus DOM suites if a
// web interface is reachable
// BASE=http://<pi-ip>:5000 node run_all.js point the DOM suites at a rig
// REQUIRE_DOM=1 node run_all.js fail, rather than skip, when the DOM
// suites can't run (CI sets this)
//
// Unit suites need nothing but node. The DOM suites need `npm install` (jsdom)
// and a running web interface, because they deliberately test against the real
@@ -44,7 +46,11 @@ function run(file) {
const haveJsdom = fs.existsSync(path.join(__dirname, 'node_modules', 'jsdom'));
const up = await reachable(BASE + '/');
if (!haveJsdom) {
if (process.env.REQUIRE_DOM && (!haveJsdom || !up)) {
// A skipped suite reads as a pass in CI; say why and fail instead.
results.push([haveJsdom ? `DOM suites (no web interface at ${BASE})`
: 'DOM suites (jsdom not installed)', false]);
} else if (!haveJsdom) {
console.log(`\nSKIPPING DOM suites: jsdom not installed (run: npm install)\n`);
} else if (!up) {
console.log(`\nSKIPPING DOM suites: no web interface reachable at ${BASE}`);