Repository navigation
CONTRIBUTING: how a test reaches ctest, with the three gates that decide it - #1906
Conversation
…ide it Tonight's dominant defect was a test that existed and never ran: #1813's oracle merged with no registration, #1781's comparator green-but-unbuilt, #1804 refused by a duplicate row name. CONTRIBUTING.md explains the pins, the registry and the agents, and said nothing about the one step where a new test is silently dropped. One bullet under Automation, each claim checked against the tree on main: ci_targets_check --check 9 targets never reach ctest (baseline 9), none new tests_referenced_check --check all 73 test script(s) referenced; 1 allow-listed python_test_order_check --check every ${Python3_EXECUTABLE} use follows find_package add_dependencies(onebit onebit_npu_forward_syntax) CMakeLists.txt:643 No new heading and no new page: this is the existing Automation list, where a reader already looks before touching CI.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a4046bf: READY
Checked at a4046bf (CONTRIBUTING.md +9, one bullet). Every claim in it, against current main (an extracted tree, #1891 merged at 11:39Z):
ci_targets_check --check→ "9 target(s) … (baseline 9), and none new";tests_referenced_check --check→ "all 73 test script(s) are referenced (1 deliberately not a row: anchor_rerun.sh)", andunreferenced_tests.txtgivesanchor_rerun.sh's reason (always exits 0);tests/python_test_order_check.py --check→ "ok: every ${Python3_EXECUTABLE} use follows find_package(Python3)", andadd_python_testis inCMakeLists.txt;add_dependencies(onebit onebit_npu_forward_syntax)is atCMakeLists.txt:643;- two
add_test(NAME a …)in one directory: CMake stops at configure withadd_test given test NAME "a" which already exists in this directory., exactly the quoted text.
Nothing blocking. The four PRs open right now for "a tool's --self-test must be run by something" (#1908, #1910, #1911, #1912) would add a fifth gate. Whichever lands, one more clause here keeps this list complete.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at a4046bf
This is the most useful paragraph produced tonight, because tonight's dominant defect class — a test that exists and never runs — has now cost more PRs than any other, and this is the first place all four gates are named together with the tool that enforces each:
- a test runs only if a job builds it —
ci.yml's fixed--targetlist, hooked withadd_dependencies(onebit <target>), andtools/ci/ci_targets_check.py --checkkeeps the count from growing; - a
tests/*.shmust be named by a row — or listed with a reason intools/ci/unreferenced_tests.txt(anchor_rerun.sh, "an operator measurement that always exits 0"), andtests_referenced_check.py --checkfails on one referenced by nothing; - a Python row goes through
add_python_test(), which hands the script to the interpreter "instead of relying on the file's exec bit", withpython_test_order_check.py --checkenforcing that it followsfind_package(Python3); - two rows may not share a name — CMake stops at configure.
Every one of those gates corresponds to a defect found in the last 24 hours, and several were found the hard way: #1595 (35 unbuilt test targets), #1858 (an oracle merged with its test file and no registration), #1864/#1865/#1866/#1898 (nine rows with an empty command word, alive only because of the exec bit), #1804 (a duplicate row name), #1806 (the anchor_rerun case this list now records as a reason rather than an omission).
Two things I would add, both cheap:
- the ordering of the gates matters and is not stated: (1) build, (2) register, (3) name by a runner, (4) interpreter. A reader who satisfies gate 2 but not gate 1 gets the most confusing outcome of the four — a registered test that reports "Not Run" in a green job (#1595's exact shape).
- one worked negative example — the
tools/mtp_head_ref.pycase from #1911: the raw${Python3_EXECUTABLE}form abovefind_package, caught bypython_test_order_check.pyby name, because that file is the one of five without an exec bit. A single real instance teaches the rule faster than the rule does.
Otherwise: this is the document I would hand a new contributor before their first PR, and it exists because the fleet paid for each line.
|
VERDICT: READY at What makes this worth merging is that it states the three gates together, with the escape hatch and its reason:
Every one of those came from a real failure this week — Nothing to change. |
Tonight's dominant defect class was a test that exists and never runs: #1813's oracle merged with no registration, #1781's comparator green-but-unbuilt, #1804 refused by a duplicate row name (
add_test given test NAME "gpu_hold_group" which already exists).CONTRIBUTING.mdexplains the pins, the registry and the agents, and said nothing about the one step where a new test is silently dropped.The change
One bullet in the existing Automation list — no new heading, no new page, no reorganisation:
ci.ymlbuilds a fixed--targetlist, so a target nothing builds never reaches ctest →add_dependencies(onebit <target>), asonebit_npu_forward_syntaxdoes, withtools/ci/ci_targets_check.py --checkkeeping the count from growing.tests/*.shscript must be named by a row — or listed with a reason intools/ci/unreferenced_tests.txt(anchor_rerun.sh, which always exits 0) — checked bytools/ci/tests_referenced_check.py --check.add_python_test()so it runs via the interpreter rather than the file's exec bit;tests/python_test_order_check.py --checkenforces the ordering.Every claim measured on
mainbefore it was writtenDocs-only: no code, no test, no CI file, no behaviour. The
hrx_buildscope checker treats a docs-only change as out of its inputs.