Repository navigation
test: run test-all.sh in CI with a summary (#174 follow-up) - #187
Conversation
test-all.sh used `set -e`, so it stopped at the first failing file and the rest never ran. Each file now runs through run(): failures are counted, the summary lists every failed file, and the script exits 1 if any file failed. - register test-live-anims.js (fixed in #177, never registered) - test-test-all.js: runs the real test-all.sh under /bin/sh and dash with fixture files (a failure does not stop the run, is listed, exit is non-zero; all green exits 0) and checks the file list (exists, no duplicates, no Playwright/BASE_URL files) - test-privacy-page.js asserted the literal `set -e`; it now asserts the `run` registration line and the exit-1 path Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-all-ci # Conflicts: # test-all.sh
The "Run JS unit tests" step in the Go Build & Test job listed 88 files, 44 of which test-all.sh also listed, while the 64 other test-all.sh files never ran in CI. The 44 files that were only in deploy.yml move into test-all.sh, and the step now runs `sh test-all.sh`: one list, every file runs once, and the step fails if any file fails. Node 22, local, 3 runs: old step (88 files) ~7.9 s, test-all.sh after this change (152 files) ~12.2 s. Keeping the old lines and adding a test-all.sh step would take ~16.8 s and run 44 files twice. Fork guards unchanged (9). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70 root test-*.js files were run by neither test-all.sh nor deploy.yml. Of the 62 without "e2e" in the name, these 45 pass on Node 22 without node_modules or a server (3 consecutive full test-all.sh runs green). test-live-anims.js was registered in the first commit. The 16 red ones are listed in the PR and not changed here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Of the eight root *e2e*.js files that no runner registered, these four pass locally (3/3 runs each, Node 22, Chromium 1208): - test-a11y-1705-subpath-hop-prefix-e2e.js - test-a11y-1719-contrast-root-causes-e2e.js - test-nodes-favorite-rerender-e2e.js - test-packet-trace-alignment-e2e.js None uses the fixture server. The other four stay out (listed in the PR). Fork guards unchanged (9). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test-test-all.js now lists every root test-*.js and requires each one to run in test-all.sh (`run <file>`) or deploy.yml (`node <file>`). The 21 files that cannot run yet are in KNOWN_UNREGISTERED with a reason; an entry that is deleted or gets registered must be removed, so the list can only shrink. Mutants (all red): a new unregistered root test; an allowlisted file registered; a test-all.sh line dropped; an E2E line dropped from deploy.yml; an allowlisted file deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…174) Review nit from #177: the tests covered the repeater and room icons only. The new case checks all four role icons and the first-to-hear #ph-flag, each as an aria-hidden sprite icon at the start of its tooltip, and that no tooltip icon lacks aria-hidden="true". Mutants (all red): phIcon without aria-hidden; flag removed; flag swapped for another glyph; flag inlined without aria-hidden; sensor or client icon dropped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#174) Review nit from #178: section G covered the <body> read, but not the `document.body || document.documentElement` fallback. roles.js loads in <head>, where body is still null. Section H nulls body, makes getComputedStyle throw on null (as browsers do) and serves a non-default value on documentElement only. Mutants: "getComputedStyle(document.body)" only is red in H; "documentElement only" (the pre-#178 code) is red in G. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…js-only (#174) Review nit from #178: the 🏓 and 🤖 exceptions were line substrings in the global allowlist, so any emoji on the pong or avatar line passed, and the same text in another M3 file passed too. They are now in ALLOW_EXACT['channels.js']: each must occur exactly once, only that occurrence is cut out, and the rest of the line is still scanned. Mutants, old test → new test: extra ✅ on the pong line green → red; `<div>🤖</div>` in app.js green → red; 📡 after the avatar green → red. Also red: a second avatar in channels.js, the pong text in app.js, the 🏓 removed (stale exception). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…174) Follow-up from #173: coverageNodeRow (the RX coverage hex tooltip) escapes node names and prefixes, but no test covered it. Case 5 mounts the real page, lets createMap's deferred drawCoverage() run, answers /api/rx-coverage with one hex of hostile node names plus an unnamed node with a hostile prefix, and checks the exact escaped labels in the recorded tooltip. public/rx-coverage.js is unchanged; the vm harness is shared with cases 1-4 (mountPage). Mutants (all red in case 5): name unescaped; prefix unescaped; label always the prefix; escapeHtml without & escaping (also red in 1 and 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vas (#174) Review nits from #173: - Drain bound 5000 → 2500 ms. The burst drains in ~0.7 s locally and in CI. 10/10 runs against the instrumented frontend: 665–682 ms per viewport. - The fade-pane step only required a renderer canvas on the animations pane, which the contrail alone creates, so removing `pane:` from the main fade line (live.js ~4339) stayed green. The step now counts Leaflet renderer canvases per pane before and after the burst: exactly one on the animations pane, and no new one on any other pane. Mutants, old test → new test (served from a copy of public/): main line without `pane:` green → red; contrail without `pane:` green → red; animation 660 → 3000 ms green → red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le (#174) The pill assertion expected bare counts (>3<). Since 40aa02b (Kpa-clawbot#1360, "cluster pill shows letter+count") the pills read R3 / C2 / M1. The other 4 cases already passed. Registered in test-all.sh and removed from KNOWN_UNREGISTERED. Mutants (red): room count off by one; repeater letter swapped; pill without the letter (pre-Kpa-clawbot#1360). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he file (#174) Since b74a64c (Kpa-clawbot#1799) live.js throws at load when window.PayloadLabels is missing, so all 14 cases failed in the sandbox. index.html loads payload-labels.js first; the sandbox now does the same, like the analytics tests. Registered in test-all.sh and removed from KNOWN_UNREGISTERED. Mutants (red): occupied corners not skipped; feed default bl → tl; corner cycle reversed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"returns server defaults when overrides is {}" passed a config without
`home`; since 54fab05 (Kpa-clawbot#525) computeEffective fills in DEFAULT_HOME
then, so the deep-equal failed (59/60). The fixture now carries a
server `home`, as the real config does. Registered in test-all.sh and
removed from KNOWN_UNREGISTERED.
Mutants (red): server home always replaced by DEFAULT_HOME (red in this
case); server config dropped; server config not deep-copied.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review — CS-MacBook review PR#187 test-all i CI — head b23d8d9Dom: APPROVE med nits (approve with nits) Independent, read-only review of Tags: [F] browser run, [T] test or CI run, [A] analysis of code, [K] not checked. No blocking findings. Everything the description claims held up. The nits below are small and none needs to block the merge. Findings
Answers to points 1-61. CI step.
2.
3.
4. The 45 newly registered tests and the three repaired ones. The block is 48 files: 45 new plus the three repaired files. Each repair follows an intended change in the production code:
5. Nits 4a-4e. Each described mutant is caught, and the test that catches it is named in the table below.
6. Merge. Test counts
Mutants
CI on head (run 37109895646)
Not verified
|
Relates to #174, #173, #177, #178
test-all.shnow runs every file and prints a summary. CI runs it as the JS unit step, and a self-test makes sure that no root test file can go unrun again. It also covers the review nits from #173, #177 and #178, and an inventory of the root tests that no runner registered.No production code changed (
git diff origin/master...HEAD -- public/is empty), and no npm dependencies were added. Fork guards are unchanged: 9 ×github.repository == 'Kpa-clawbot/CoreScope'on both base and head. No guard lines, triggers, permissions or concurrency were touched.Base:
cbd562cd, withorigin/master(bedbe1f1, #167) merged in through a normal merge commit (535d6e88). The only conflict was the one-linetest-issue-147-packets-url-detail-params.jsregistration intest-all.sh.1.
test-all.sh: every file runs, with a summary at the endset -eis gone. Each file runs throughrun <file>(POSIX sh). The script counts passes and failures, lists the failed files at the end and exits 1 if any file failed.test-live-anims.jsis registered. It was repaired in test: issue 174 part A — emoji gate, live anim, naive banner, observers headings #177 but never registered.test-test-all.jsis the self-test. It runs the realtest-all.shunder/bin/shanddash(when present) in a temp dir, with its file list swapped for fixture files. It checks that:playwright, launches Chromium or readsBASE_URL.test-privacy-page.jsasserted the literalset -eline andnode test-privacy-page.js. It now asserts therunline and the exit-1 path, which is the property it was guarding.Demo in a copy, with two deliberately failing files (
throwat the top oftest-aging.js, andprocess.exitCode = 1intest-hash-color.js): all 200 files ran, and the run ended with exit 1:2. CI: one list,
sh test-all.shreplaces the JS unit linesThe "Run JS unit tests" step in Go Build & Test listed 88 files. 44 of them were also in
test-all.sh, and 44 were only indeploy.yml. The 64 othertest-all.shfiles never ran in CI. I moved the 44 deploy-only files intotest-all.shand replaced the step body withnode --versionandsh test-all.sh. The step fails if any file fails:shexits 1, and the job shell isbash -e.Timings with Node 22.22.1, run locally, 3 runs each:
deploy.ymllines)test-all.shbefore this PRtest-all.shstep (after moving the deploy-only files)test-all.shsteptest-all.sh(with the inventory below)On master, CI took about 5 s for the old step (run 37105041262, timestamps at second resolution). The chosen variant has no double runs and leaves one list to maintain. The CI unit job has no
npm ci, so I also rantest-all.shwithoutnode_modules: 200/200.3. Inventory: root tests that no runner ran
On
cbd562cd, 70 roottest-*.jsfiles were run by neithertest-all.shnordeploy.yml, and 8 of them have "e2e" in the name. A 71st,test-rx-coverage-mobile-nav-e2e.js, appears indeploy.ymlonly in a comment. The non-E2E files were run with Node 22, withoutnode_modules(as in the CI unit job), with a 120 s limit.test-test-all.jsnow also fails when a roottest-*.jsruns in neithertest-all.sh(run <file>) nordeploy.yml(node <file>), unless it is listed inKNOWN_UNREGISTEREDwith a reason. An entry that is deleted, or that gets registered, has to be removed, so the list can only shrink.Registered: 49 unit files and 4 E2E files
test-all.shruns were green.test-live-anims.js(see section 1).test-map-clustering.js: the pills read R3/C2/M1 since40aa02b4(regression(map): #1357 cluster role pills lost the count number — show letter+count not letter-only Kpa-clawbot/CoreScope#1360);test-panel-corner.js: the sandbox did not loadpayload-labels.jsbeforelive.js(b74a64cc, Label vocabulary drift across packets / live / packet-filter views Kpa-clawbot/CoreScope#1799);test-customizer-v2.js: the fixture lackedhome, whichcomputeEffectivehas filled in since54fab055(Bug: Customizer v2 home section empty + adding FAQ kills steps Kpa-clawbot/CoreScope#525).test-a11y-1705-subpath-hop-prefix-e2e.js;test-a11y-1719-contrast-root-causes-e2e.js;test-nodes-favorite-rerender-e2e.js;test-packet-trace-alignment-e2e.js.The 45 green unit files
test-1108-region-hide-nodes.js,test-a11y-1715-dark-role-swatches.js,test-analytics-distance-view-path.js,test-analytics-wardriving-tab.js,test-anl1-tooltip-render.js,test-channel-color-picker.js,test-channel-decrypt-ecb.js,test-channel-decrypt-m345.js,test-channel-live-decrypt-userprefix.js,test-channel-live-decrypt.js,test-color-picker-ux.js,test-compare-flood-filter.js,test-compare-overlap.js,test-embed-mode-1369.js,test-geofilter-draft.js,test-hash-color.js,test-issue-1166-first-seen-column.js,test-issue-1189-composed-cell.js,test-issue-1189-live-iata-badge.js,test-issue-1415-packets-layout.js,test-issue-1488-marker-stroke-vars.js,test-issue-1496-reset-all-complete.js,test-issue-1563-aggregate-and-inflight.js,test-issue-1574-live-map-max-nodes.js,test-issue-1606-pagination.js,test-issue-1644-redesign.js,test-issue-1648-followup-phosphor-leaks.js,test-issue-1648-m5-emoji-scan.js,test-issue-1668-m2-contrast.js,test-issue-1825-observer-node-cross-links.js,test-issue-1836-crossnav-case-normalization.js,test-issue-1843-node-qr-quiet-zone.js,test-live-dt-cap-1524.js,test-live-legend-helper.js,test-node-reach-coverage-debounce.js,test-observer-detail-view-path.js,test-observer-naive-clock-1478.js,test-path-inspector.js,test-payload-labels-content.js,test-payload-labels-namespace.js,test-perf-anomaly.js,test-perf-render-1258.js,test-pull-to-reconnect.js,test-rx-coverage-config-race.js,test-slideover-1056-rowsel-strict.jsRed unit files: not fixed here, proposed for a follow-up issue
The causes were checked against git history. Where the table says "test passes at X^ and fails at X", that was run.
test-channel-colors.jsgetRowStyle … assigned GRP_TXT channel: should have left border(19/2)68a4628e(Kpa-clawbot#675) changed the row style from a 4px border plus tint to a 3px border only. Intentional; stale test.test-channel-ux-followup.jsnew copy points at the ✕ button for individual key removal(28/1)b812a98a(Kpa-clawbot#1648 M3) reworded the hint to "Use the close button…". Stale.test-channel-ux-round2.jsiconBtn('ch-share-btn', ...) is called with '📤 Share'(13/1)b812a98a(Kpa-clawbot#1648 M3): the label is now the#ph-share-networksprite plus " Share". Stale.test-drag-manager.jsEscape during drag reverts to corner position(18/1)2b45f787(Kpa-clawbot#1567) switched toremoveAttribute('data-dragged'). The test's mock does not updatedataset; a real DOM does. Mock gap.test-fluid-scaffolding.jsspacing token --space-xs declared with clamp()(2/13)f0addfda(Kpa-clawbot#1668) added a palette:rootblock first, and the test only reads the first:root. The tokens still exist.test-hop-resolver-affinity.jsShould pick NodeA (geo-closest) — got: NodeB(16/1)2b9f3056(Kpa-clawbot#874), haversine centroid. The test passes at2b9f3056^and fails at2b9f3056. With haversine, NodeB really is closer (70.88 vs 71.06 km), so the fixture geometry is wrong.test-issue-1470-card-bg-contrast.js[data-theme="dark"] block sets --card-bg…: not found(9/1)e2212f50(Kpa-clawbot#1627) added astyle.csscomment containing[data-theme="dark"], andindexOflands on the comment. Passes ate2212f50^.test-issue-1646-compare-polish.js.compare-vs font-size < .compare-select font-size: could not parse(13/1)d954ea74(Kpa-clawbot#1668 M5) added a comment withfont-size:10pxinside.compare-vs, and the parser reads the comment.test-packets.jsgetDetailPreview handles CHAN type(115/13)30627454(Kpa-clawbot#1648 M2): 13 emoji assertions; the code now renders#ph-*sprites. Mechanical, but 13 edits.test-perf-disk-io-1120.jsWAL >100 MB fires ⚠️ flag(10/5)30627454:#ph-warning. The "noa26a412c(Kpa-clawbot#1593) replaced. Needs rework.test-table-sort.jsCannot find module 'jsdom'jsdomis not a dependency. Port tovmor delete.test-marker-outline-weight.jsERR_MODULE_NOT_FOUNDfor the Playwright Test runner packagepage.goto). The runner package is not a dependency, and the spec also needs a server.test-touch-targets.js.nav-btn: rendered 44.0x44.0 … expected >=48x48(5 failures, run withnode_modulesand Chromium, no server)eaf14a61(Kpa-clawbot#1060, 48px targets), and the currentstyle.csssets 44px minimums. Whether 48 or 44 is the intended target needs a decision. Not classified as stale or as a regression.E2E files that stay unregistered
All were run against a local server built with CI's fixture recipe:
freshen-fixture.sh, the Kpa-clawbot#1486/Kpa-clawbot#1791 seed block fromdeploy.yml,corescope-migrate, andseed-2073-route-adverts.sql.test-channel-modal-e2e.jstest-node-reach-e2e.jsTimeoutErrorwaiting for#nqMap .leaflet-containertest-node-reach-coverage-e2e.jsalready runs in CI, so check for overlap first. Cause not investigated.test-issue-1522-trace-url-sync-e2e.jsplaywrighttest-path-inspector-e2e.jstest-path-inspector-coverage-e2e.jsalready runs)test-rx-coverage-mobile-nav-e2e.jsclientRxCoverageis disabled in the fixture configdeploy.ymlcomment already says so4. Review nits
test-pr-1490-live-map-gpu-animations-e2e.js: drain bound 5000 → 2500 ms. The fade-pane step now counts Leaflet renderer canvases per pane before and after the burst: exactly one on the animations pane, and none added elsewhere. Before, the contrail alone satisfied the check.<vp>: the animations drain to 0,<vp>: the fading polylines render on the animations pane onlytest-rx-coverage-escape.jscase 5: mounts the real page, runscreateMap's deferreddrawCoverage(), answers/api/rx-coveragewith hostile node names and an unnamed node with a hostile prefix, and checks the exact escaped labels in the hex tooltip (coverageNodeRow). The cases share amountPageharness.public/rx-coverage.jsis unchanged.5. hex tooltip: hostile node names and prefixes are escapedtest-packet-path-map.js: all four role icons and the first-to-hear#ph-flagare aria-hidden sprite icons at the start of their tooltips, and no tooltip icon lacksaria-hidden="true"role icons and the first-to-hear flag render as aria-hidden sprite iconstest-issue-1407-cb-preset-propagation.js§H:document.body = null,getComputedStyle(null)throws (as in browsers), and the value exists only ondocumentElementdocument.body null: ROLE_COLORS.repeater resolves on documentElementtest-issue-1648-m3-emoji-scan.js: 🏓 and 🤖 moved toALLOW_EXACT['channels.js']. Each must occur exactly once; only that occurrence is cut out, and the rest of the line is still scanned. The 🤖 entry is now the full avatar element.channels.js clean …/app.js clean …Note for (a): the commit message of
b4c96772gives 665–682 ms for "10/10 runs against the instrumented frontend". Those 10 runs actually hit a server that still served plainpublic/, because my local start script stopped the wrong process. I reran with the instrumented build: the servedlive.jscontains__coverage__. All 10 runs were green, at 668–684 ms per viewport. The bound (2500 ms) is unaffected.Mutants
Each mutant ran in a copy of the tree (rsync, never in the worktree). The E2E mutants were served from a copy of
public/on a second server.live.js~4339:pane:removed from the main fade line onlythe fading polylines render on the animations pane only("added a renderer canvas to overlay")pane:removed from the contrail onlythe animations drain to 0coverageNodeRow: name not escapedescapeHtmlwithout&phIconwithoutaria-hiddenaria-hiddengetComputedStyle(document.body)onlydocumentElementonly (pre-#178)channels.js clean<div>🤖</div>inapp.jsapp.js cleanchannels.js cleanchannels.js/ pong text inapp.js/ 🏓 removed (stale exception)channels.js clean/app.js cleantest-all.sh: old semantics (barenodeunderset -e)failures do not stop the run(sh + dash)exit 1removed / failure counted as a pass / failed file not recordedno file is registered twice/every registered file exists/no registered file needs a browser or a serverevery root test-*.js runs …/KNOWN_UNREGISTERED has no stale entriesset -eadded in front of the newrun()noderuns inside anifcondition, whichset -eignorestest-all.shwithout the exit-1 path / oldnoderegistration linetest-privacy-page.js is registered exactly once in test-all.shtest-map-clustering.jspill casebl→tl/ cycle reversedtest-panel-corner.jshomealways replaced / config dropped / not deep-copiedtest-customizer-v2.jsPossible production bug found, not fixed (
public/packets.jsis on the do-not-touch list)When
30627454(Kpa-clawbot#1648 M2) migrated▶/▼to sprites, the collapsed packet-group toggle became#ph-caret-up(public/packets.js:2359), while the expanded one is#ph-caret-down. Collapsed toggles elsewhere useph-caret-right, which is in the sprite. Collapsed group rows probably show an up-caret. Found while diagnosingtest-packets.js, checked in the source and the diff, not checked in a browser.Other notes
test-issue-1697-mqtt-mobile-e2e.jshas "e2e" in its name but is a vm unit test (it was already in the unit step). It moved intotest-all.sh, so the E2E check looks at content (playwright,chromium.launch,BASE_URL), not names.Verification (local, macOS, Node 22.22.1)
sh test-all.sh(/bin/shanddash), with and withoutnode_modulessh test-all.shwith two deliberately failing files (copy)test-pr-1490-…-e2e.js, plainpublic/test-pr-1490-…-e2e.js,public-instrumented/Not verified
test-touch-targets.js: whether 44px or 48px is the intended target.test-node-reach-e2e.js: the cause of the timeout was not investigated./bin/sh(dash) locally: only macOS/bin/dashwas tested. CI's ubuntu runner covers it.🤖 Generated with Claude Code