Gate COVERAGE.md's per-file inventory tables against disk - #231
Open
danielrmerskine wants to merge 1 commit into
Open
Gate COVERAGE.md's per-file inventory tables against disk#231danielrmerskine wants to merge 1 commit into
danielrmerskine wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pynow validates, all in the requiredstatic-checksjob:(-- N files)section header count (unchanged)Missing row: fail, naming the file. Row for a deleted file: fail, and
--fixremoves 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).
--fixnever 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-onlyand full mode (box run-count differslocally 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
--fixremoves it and passes);--fixwith a missing row still exits 1.