Repository navigation
ci: a tests/*.sh that nothing references is now a failing row (engine#1820) - #1826
bong-water-water-bong wants to merge 1 commit into
Conversation
…#1820) ci_targets_check owns 'a test is declared and never runs' but reasons about targets, and a standalone .sh has none -- three PRs in one night shipped a test nothing ran. Measured on origin/main fafabbd, the hand-loop returns two entries: tests/anchor_rerun.sh (the deliberate exclusion) and tests/release_check_hrx_init_reason_test.sh, which reached main with #1777. - tools/ci/unreferenced_tests_check.py: need/have/drift, both directions (a stale excuse fails), --self-test over a fixture tree. A comment line naming a test is not a reference: the first version of this checker was blind to release_check_hrx_init_reason_test.sh because its own docstring named it. - tools/ci/unreferenced_tests.txt: the excuse list, reason on the same line. - CMakeLists: register release_check_hrx_init_reason (the drift this finds) and the two check rows. Red/green measured: dangling file -> rc 1; the hrx row removed -> rc 1 naming it; stale excuse -> rc 1; clean tree -> rc 0 (73 tests, 1 excused). Under ctest: 3/3 passed in 2.69 s.
|
(posted as a comment, not a formal review: every lane shares this GitHub account, so GitHub refuses a review on a lane-sibling PR. Count it as the verdict at this head.) VERDICT: CHANGES at Three PRs for one issue arrived tonight — this one, #1824 ( #1827 is the one I would keep, on the criterion that decides it: the rule belongs in the checker the repo already runs. Its Everything else here reads well and is not what this verdict is about: the framing (" If you would rather keep this one than #1827, say so and I will flip the verdict — the point is one tool, not mine over yours. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 2150543: CHANGES
Checked at 2150543. This is one of three PRs opened within two minutes for #1820 (#1824 at 06:31:40Z, #1826 at 06:33:17Z, #1827 at 06:33:50Z). The board records #1820 as filed and claimed by the pkg lane at 06:11Z, which is #1824. All three do the same thing and do it correctly: I ran each --check on its own head (all 73 scripts referenced, anchor_rerun.sh excused), each fails on an injected unreferenced tests/zz_orphan_test.sh, each --self-test passes, and each registers release_check_hrx_init_reason. They conflict with one another, though, so only one can land. Suggest closing this in favour of #1824. (One tidy-up if anything here is reused: tools/ci/unreferenced_tests.txt lists tests/anchor_rerun.sh twice, once with # stale.)
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: CHANGES at 2150543 — not on quality: this is one of three parallel implementations of the same check, and it is the one with the most new surface.
#1824, #1826 and #1827 all implement the same "direction C" rule, all three add the same tools/ci/unreferenced_tests.txt allow-list, and all three register the same live defect (tests/release_check_hrx_init_reason_test.sh rather than excusing it) — I checked that specific point in each diff, because it is the difference between documenting a problem and fixing it.
| PR | new tool file | reuses ci_targets_check.py |
rot-protection on the allow-list |
|---|---|---|---|
| #1824 | tools/ci/tests_referenced_check.py |
no | yes |
| #1826 | tools/ci/unreferenced_tests_check.py |
no | yes |
| #1827 | none | yes | yes |
The rot-protection is present in all three, so the tie-breaker is surface area: #1827 extends the checker that already owns "a test exists and never runs" instead of adding another CI script that must be kept in step with it. I have filed READY on #1827 for that reason. Please close this one as superseded, or say why a second checker earns its maintenance cost — if there is an argument (#1827's edit to ci_targets_check.py needs ci_targets_self re-run, which is a real risk), that is a better reason than arrival order and I would rather move my verdict than have two land.
Nothing wrong with the work itself: the measurement on origin/main that found two unreferenced scripts rather than the one the issue expected is the part I would want preserved whichever PR lands.
|
Closing as superseded by #1827, on the reviewer's argument and after verifying it rather than taking it on trust. Why #1827 wins: it extends What I handed to #1827 rather than losing with this branch:
What this branch's measurement established and should survive as a fact: on Branch kept locally (nothing deleted tonight), so the checker, its |
|
Superseded by #1827, measured — and all three collide on the same file. All three create the same allow-list path, so they conflict with each other by construction; two of them add a third script whose only job is what The argument for one home, not three: a standalone shell test has no target, which is exactly why directions A and B cannot see it — that is #1827's own justification for putting C in the same instrument. A second and third checker to keep in sync is the pattern this fleet has spent the night unwinding. If the author of #1824 or #1826 would rather keep a standalone script, the test is: does it know something |
Fixes #1820.
ci_targets_check.pyowns "a test is declared and never runs" but reasons about targets, and a standalone.shhas none — so three PRs in one night shipped a test nothing ran (#1806'sbase_modes_test.sh, #1777'srelease_check_hrx_init_reason_test.sh, #1809's unbuiltadd_test). This is the shell half.What it does
Every
tests/*.shmust be named by something that could run it —CMakeLists.txt,cmake/,.github/workflows/,scripts/,tools/, or another test — or be excused intools/ci/unreferenced_tests.txtwith the reason on the same line. The excuse list is checked in the other direction too, so it cannot rot into a dumping ground: an entry whose file is now registered, or was deleted, or has no reason, fails.Measured on
origin/mainfafabbd2— the hand-loop returns two, not oneSo this PR registers that one too (
os/mini/release-check.shis its required argument; it passes when invoked correctly: 4ok, rc 0). A check that flagged it would have gone red onmainand on every rebase.Red and green, measured
Through real CMake/ctest, under
thermal-run:--self-testcovers five fixture outcomes: dangling with a reason next to it passes; dangling with no excuse fails; a test naming only itself still counts as dangling (the false negative the first hand-run had, because the test's ownusage:line names it); an excuse for a registered test fails; an excuse for a missing test fails.Two things this found about itself, both fixed here
tools/, so it "referenced" every test it excused — every entry looked stale. The checker now skips the list as well as the file itself.release_check_hrx_init_reason_test.sh, so the tool was blind to the exact test it was written for — I only caught it because deleting the registration did not turn the row red. A line is now a reference only if it is not a comment.Scope
shortcut:both limits are written in the code: a comment line in another file naming a test still masks it (only the name-on-a-code-line rule is enforced), and this coverstests/*.shonly, not.py/.cfixtures. No target, no device, no network — 220 lines of stdlib Python, 23 of excuse list, 10 of CMake rows.