Repository navigation
List every node --test input in the CI guard - #3441
Conversation
The frontend test step ran three node --test inputs behind an ls guard that listed only .github/scripts/*.test.mjs. node --test exits 0 with zero tests when a pattern matches no file, so renaming tests/ or the compose planner file would have left the step green with missing coverage. List all three inputs before the run, in a block scalar, and make tests/ci_test_list.test.mjs require the guard and the run line to name exactly the same inputs: the guard must come first, and neither a missing guard entry nor an input dropped from the run line may pass. Related #3440
|
Lead review — slice check for head Scope: one slice — the frontend Coordinates (read from this head, not carried over): base Why the assertion is two-way equality: the first two drafts were fail-open and both were caught before this PR. v1 compared the guard against itself. v2 checked only Local readings (this machine, node v22.23.5; not CI):
QA verified the same head independently (local, not CI): CI on this head (read from the check-runs API, not inferred): This head goes into the queue only now: when it was first read, three checks were still running ( Separately, main Rules: only Not claimed: that the 1118 count is stable; that this makes the CI step immune to a pattern that matches no file in every other workflow (this slice covers this one step); acceptance sign-off. Enqueueing this head as Related #3440. |
Related #3440
What this changes
.github/workflows/tests.ymlruns threenode --testinputs in one step, but itslsguardcovers only
.github/scripts/*.test.mjs.node --testexits0with zero tests when a patternmatches no file (measured on
v22.23.5; the workflow comment records the same for Node 24.22), soa rename or move of
tests/or of the compose planner file would leave this step green withmissing coverage.
Two files,
+27/−7:.github/workflows/tests.yml(+6/−3): the step becomes a block scalar — onelslisting allthree inputs, then the same
node --testinvocation as before.tests/ci_test_list.test.mjs(+21/−4): the literal whole-line assertion is replaced by astructural one. The block must hold an
lsline and anode --testline, thelsmust comefirst, and the argument sets of the two lines must be exactly equal (sorted
deepEqual: listingorder is free, membership is not). The assertion is bidirectional on purpose — a one-way
"everything on the run line is guarded" check still passes when an input is deleted from the run
line, which is the silent-coverage-loss case this PR is about.
The test invocation itself is unchanged: same three inputs, same order, same Node version (
22,tests.yml:26). Only the guarding around it changes.Verification (local, not CI)
Host: this machine,
node v22.23.5,TMPDIRon disk. Baseline for the comparison is mainee8ae6df3e3ee10af8cad63e5e7e078db4fc9bd8, treedffcaed5782aedb4f710695d9d06af9bd5d2e93e; thepatch was
git apply --checked against that exact tree (exit0).The step body still passes. Running the patched block body verbatim under
bash -e:# tests 1117 / # pass 1117 / # fail 0 / # cancelled 0, exit0. One run, one host — thetests/ds_bot_bridge.test.mjstiming case is known to flake under load (a second host saw1116/1once), so this number is a single local reading, not a stability claim.The guard fires. With
tests/renamed away, thelsreportscannot access 'tests/*.test.mjs', step exit2, and the run line never executes.The new assertion is not fail-open. Four edits of the patched workflow each turn
tests/ci_test_list.test.mjsred:node --testmoved above thelsthe ls guard must come before node --testthe ls guard must list exactly the inputs on the node --test line(+ visible diff)lsline deletedthe block must hold an ls guard and a node --test linethe ls guard must list exactly the inputs on the node --test line(+ visible diff)2/2 passThe last mutation is the one that made the earlier drafts wrong, twice: the first draft compared
the block's first line with itself and stayed green when the
lswas moved or removed; thesecond compared argument sets one way only and stayed green when
tests/*.test.mjswas droppedfrom the run line — that variant still ran
150/150 pass, exit 0in the step body while 967 webtests had silently disappeared. Both gaps are shut here; the coverage loss now fails the workflow.
No actionlint.
actionlintis not installed on this host and the repository has no workflowsyntax job, so the YAML side is backed by parsing the file plus executing the block body under
bash -e, not by a linter. A CI run of the modified workflow is the first real check of theYAML form.
Not in this PR
tests/test_isolated_bot_social.py,and
deploy/isolated/build_manager_release.pyhaving no test or job at all) are separate slices.Risk and rollback
Metadata and test-only: no product code, no runtime path. Rollback is reverting the two files; the
previous inline
ls ... && node --test ...form keeps working unchanged.