5011b739391b6a1b6129d473b6c050010baf1f6f
braney
  Sat Sep 19 17:57:37 2026 -0700
testRegistry: a registry of which unit test defends which ticket

A bug ticket has no way to say whether a test now defends its fix, and a test
has no way to say which bug it came from.  The two questions are asked from
opposite ends and neither the tree nor Redmine answers either one.

utils/testRegistry/registry.tsv is that table, hand written, one row per ticket
per test, starting at v504.  Unit tests only: the browser-page regression tests
are the docent suite, refs #38252, which already names each script for its
ticket, and a docent column here says which ticket has one of those too.

Each row says why a unit test is the right test, because "the fix is in a
library file" is wrong in both directions.  A wording fix in hg/lib needs no
unit test, and a performance rewrite inside hgTracks needs one badly, since
nothing else can tell that the slow path has come back.  The three reasons are
invisible, perf and library, and a perf row says what has to be measured --
queries, passes, allocations, bytes -- never wall-clock seconds.

testRegistry reads it: ticket, test, release, why, needed, unwatched, tickets,
check.  No network and no database, so the check can run anywhere.

check is why the table is checked in rather than derived.  A registry that
quietly names files nobody has, saying a bug is covered when it is not, is
worse than no registry, so check fails the build the day a row rots.  Its own
tests are in tests/, with one row of input/bad.tsv per complaint check can
make, and utils/makefile runs the whole thing so it reaches make test from src.

Today: 37 tickets, 12 covered by 11 tests, 25 waiting.

refs #38391

diff --git src/utils/testRegistry/tests/expected/check.out src/utils/testRegistry/tests/expected/check.out
new file mode 100644
index 00000000000..1edf250b8f1
--- /dev/null
+++ src/utils/testRegistry/tests/expected/check.out
@@ -0,0 +1,12 @@
+input/bad.tsv:5: ticket 37263: already on line 4
+input/bad.tsv:6: ticket 38000: lib/tests/noSuchTest.c is not in the tree
+input/bad.tsv:7: ticket 38001: release 'v504' is not a version number
+input/bad.tsv:8: ticket 38002: evidence 'watched-it' is not one of unrecorded, assertion-only, sandbox-ab, release-ab, caught-regression
+input/bad.tsv:9: ticket 38003: why 'slow' is not one of invisible, perf, library
+input/bad.tsv:10: ticket 38004: no note, so nobody can tell what the test holds down
+input/bad.tsv:11: ticket 38005: no test, so the evidence column must be -
+input/bad.tsv:15: ticket 38007: hg/utils/docent/tests/regress/rm38007.docent.yaml is not in the tree
+input/bad.tsv:16: ticket 38008: a docent script for this ticket is named rm38008.*, not rm38303.docent.yaml
+input/bad.tsv: ticket 38006 says both covered and waiting
+input/bad.tsv: rows are not sorted by ticket then test
+  exit 1