Repository navigation
Description
What happens
The frontend test step in .github/workflows/tests.yml runs three node --test inputs in one
invocation, but its ls guard covers only one of them:
# .github/workflows/tests.yml:30 (main ee8ae6df, tree dffcaed5)
- run: ls .github/scripts/*.test.mjs > /dev/null && node --test tests/*.test.mjs .github/scripts/*.test.mjs manager/compose-planner/compose-command-planner.test.jsnode --test treats a pattern that matches no file as zero tests and exits 0. The comment two
lines above (tests.yml:27-29) states exactly this, and the ls is there because of it — but only
.github/scripts/*.test.mjs is listed. The other two inputs, tests/*.test.mjs (55 files) and
manager/compose-planner/compose-command-planner.test.js, are unguarded.
So if tests/ is renamed or moved, or the compose planner file is renamed, the step still runs,
finds fewer (or no) tests, and goes green.
Measured on this host, node v22.23.5, in a scratch directory:
$ node --test 'nothing/*.test.mjs'
# tests 0
# pass 0
# fail 0
$ echo $?
0
The workflow comment records the same behaviour for Node 24.22, so this is not version-specific.
Why the existing test does not catch it
tests/ci_test_list.test.mjs matches the whole step line as one literal regex:
assert.match(
workflow,
/^ {6}- run: ls \.github\/scripts\/\*\.test\.mjs > \/dev\/null && node --test tests\/\*\.test\.mjs .../m,
);That pins the current string, but it cannot express the invariant that matters: every argument of
the node --test line is listed by the ls guard above it. A rename of tests/ does not touch the
workflow text at all, so no text assertion can catch that case — only the guard can. And an edit
that appends a fourth input to the run line is caught only by accident (the literal no longer
matches), not because the guard was checked.
Proposed change (one slice)
- Turn the step into a block scalar and list all three inputs before running:
- run: |
ls tests/*.test.mjs .github/scripts/*.test.mjs manager/compose-planner/compose-command-planner.test.js > /dev/null
node --test tests/*.test.mjs .github/scripts/*.test.mjs manager/compose-planner/compose-command-planner.test.js-
Replace the literal-line assertion in
tests/ci_test_list.test.mjswith a structural one: the
block must hold anlsline and anode --testline, thelsmust come first, and the set of
arguments on the two lines must be exactly equal (sorteddeepEqual, so listing order is
free but membership is not). Failure output names the missing or extra input.Equality in both directions matters: a one-way
runArgs ⊆ guardArgscheck still passes when an
input is deleted from the run line, which is the silent-coverage-loss case this issue is about.
Acceptance check
-
With
tests/renamed away, the step must fail (measured:ls: cannot access 'tests/*.test.mjs': No such file or directory, step exit2,node --testnever starts). -
Each of these four edits of the workflow must turn
tests/ci_test_list.test.mjsred, with a
distinct message:mutation expected message move node --testabove thelsthe ls guard must come before node --testappend an unlisted input to the run line the ls guard must list exactly the inputs on the node --test line(+ visible diff)delete the lslinethe block must hold an ls guard and a node --test linedelete one input from the run line only the ls guard must list exactly the inputs on the node --test line(+ visible diff) -
With the guard restored, the step body itself must still pass all tests it runs (
1117on one
host at the time of writing; see the PR for the exact reading and its caveats).
Scope
Workflow guard and one test file. No product code, no test-suite contents changed, no new CI job.
Activity
Birfy commentedon Nov 29, 2026
Branch
dev/3440-ci-ls-guard-all-inputs, basemain3f9b8ab06cb6d5f14e458ed411cf24e1281b4f78, headb78bf7d8d424bd4c3676f03aca654b1092d046b4(treef3b247f7b4d0bbdd07763ee45f8d9605f2354cc4), 2 files+27/-7. PR: #3441.Local, not CI: the patched step body runs and exits 0;
tests/ci_test_list.test.mjsis 2/2 there, and turns red on each of four workflow edits (guard after the run line, unlisted input added to the run line, guard line deleted, one input deleted from the run line).Related #3441. Refs #3440.
Birfy commentedon Nov 29, 2026
Landed as a squash merge —
192e72fcd1b630e563306a3abcac38b4e123a01d, single parent3f9b8ab06cb6d5f14e458ed411cf24e1281b4f78.Content check after the merge (read from the commit, not from the PR):
f3b247f7b4d0bbdd07763ee45f8d9605f2354cc4— the same tree that was reviewed at headb78bf7d8d424bd4c3676f03aca654b1092d046b4, so what landed is what was reviewed.+27/−7:.github/workflows/tests.ymlblobccf1d5e52862,tests/ci_test_list.test.mjsblobc8a0a614aac1.dev/3440-ci-ls-guard-all-inputsis gone (ref 404).What is now true on
main: thefrontendstep lists its three inputs before running them, andtests/ci_test_list.test.mjsasserts the guard and thenode --testline carry the same inputs in both directions. A dropped input, an added one, a reordering, or a rename oftests/now fails the step instead of running a smaller suite and exiting 0.Evidence state at the reviewed head, kept separate: CI on
b78bf7d8wastotal_count 18 == returned 18, allcompleted+success, everyhead_shaon that commit. The local readings (clean 2/2, mutations A–D red, renamedtests/→ exit 2 with nonode --testinvocation) are this machine and QA's, both stated as local. Neither is an acceptance sign-off.One note for the record: the risk workflow labelled this PR
risk:T3on its own. Risk tiers are not a merge gate here — the decision was mine, on the diff above, with the head and the CI reading named.Still not covered by this slice: the same zero-match pattern can exist in other workflows'
node --testlines. This issue is about the one step that had it.Related #3440.
Birfy commentedon Nov 29, 2026
Closing: the work this issue describes is on
main.PR #3441 merged as squash
192e72fcd1b630e563306a3abcac38b4e123a01d, treef3b247f7b4d0bbdd07763ee45f8d9605f2354cc4— the tree the review was bound to — 2 files+15/−7. Review record on the PR: comment7254485316. CI on the pre-merge headb78bf7d8: 18 of 18 checkscompleted+success.What that changed: the
lsguard in.github/workflows/tests.ymlnow lists every input of thenode --testline, andtests/ci_test_list.test.mjsasserts the two lists are equal item by item, so dropping an input from either side fails the guard instead of silently shrinking the run. The silent shrink we measured before the fix —150cases instead of1118, exit 0 — is what the assertion is aimed at.Everything this issue asked for is in. Any further work on that guard (triggering it from more workflows, for instance) belongs in a new issue, not here.