Skip to content

Gate COVERAGE.md's per-file inventory tables against disk - #231

Open
danielrmerskine wants to merge 1 commit into
mainfrom
de/coverage-inventory-check
Open

Gate COVERAGE.md's per-file inventory tables against disk#231
danielrmerskine wants to merge 1 commit into
mainfrom
de/coverage-inventory-check

Conversation

@danielrmerskine

Copy link
Copy Markdown
Collaborator

The checker's docstring named its own gap: header counts and run counts were enforced, but
nothing required a new test file to have a row in its section's inventory table -- so a count
could be corrected without ever saying which file was added. This closes that gap.

What check_coverage_counts.py now validates, all in the required static-checks job:

  • the six gated run-count rows and the total (unchanged)
  • every (-- N files) section header count (unchanged)
  • NEW: each of the nine per-file inventory tables lists exactly the test files on disk.
    Missing row: fail, naming the file. Row for a deleted file: fail, and --fix removes it.
    A table that parses to zero rows fails loudly (catches a format change or a deleted table
    rather than silently passing on an empty comparison).

--fix never generates a row for a new file: the description must be written by the author.

Doc fixes in the same change: the tree diagram and one prose line had drifted (box 62->74
files, cli 43->50, unit total 116->135, cli/tests 5->7, and the strengths line's
56 files / 1142 tests -> 74 / 1554). The enforced headers and tables were already in step;
only the unchecked copies had rotted.

Verified: clean pass on this tree in --files-only and full mode (box run-count differs
locally only by 7 Linux-only skips: /proc and flock tests); fault-injected both failure arms
(row deleted -> fail naming the file; bogus row -> fail, then --fix removes it and passes);
--fix with a missing row still exits 1.

tools/check_coverage_counts.py now checks that each inventory table
lists exactly the test files on disk: a new file with no row, or a row
naming a deleted file, fails the required static-checks job. --fix
drops rows for deleted files but never writes one -- a row's
description has to come from the author, and no check can tell a real
description from a placeholder. Like the header counts, the inventory
pass is pure filesystem work and runs under --files-only.

Also brings the unchecked copies of the counts back in step with disk:
the tree diagram (box 62->74, cli 43->50, unit total 116->135,
cli/tests 5->7) and the box-side strengths line (56 files / 1142 tests
-> 74 / 1554). The checked headers and tables were already correct;
these prose copies had drifted -- the same failure mode the checker
exists to stop. The tables are now enforced; the tree diagram and
prose remain unchecked, and the docstring says so.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant