Skip to content

Fail CI if a critical test case disappears#65

Merged
kmatzen merged 2 commits into
mainfrom
ci/require-critical-tests
Jul 18, 2026
Merged

Fail CI if a critical test case disappears#65
kmatzen merged 2 commits into
mainfrom
ci/require-critical-tests

Conversation

@kmatzen

@kmatzen kmatzen commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Fixes #58.

#63 makes CI fail if a fixture fails to generate. That covers the mechanism by which the suite had actually been shrinking, but not a TEST_CASE deleted outright, or one gated on something other than a fixture.

CI now checks by name for the cases covering bugs that reached main and were expensive to find:

Names, not a count

#58 suggested a minimum test-case count. I argued against it in the issue and still think names are the better shape:

  • A count needs bumping on every test addition, which trains people to update it reflexively — including when it drops for a bad reason.
  • It reports "the number changed", not which coverage was lost.
  • Names need no maintenance when tests are added, and fail with exactly what went missing.

Verified both directions

All five names resolve against the current binary; a deliberately bogus name is reported and fails the step.

The whitespace strip is load-bearing and worth a look in review. The heredoc has to be indented to satisfy YAML, so each name arrives with leading spaces and would never match the --list-tests output. Without the strip, the loop matches nothing and the step passes — the same silent-success shape this check exists to prevent. I only caught it because I ran the logic before trusting it.

🤖 Generated with Claude Code

kmatzen and others added 2 commits July 18, 2026 16:38
Requiring the fixtures (#63) catches a fixture that fails to generate, but
not a TEST_CASE deleted outright or gated on something other than a
fixture. CI now checks by name for the cases covering bugs that reached
main and were expensive to find: the seek contract on both the plain and
B-frame fixtures, the EOF drain, position-counter drift, and seek past the
end.

Checking names rather than a total count was deliberate. A count needs
bumping on every test addition, which trains people to update it
reflexively -- including when it drops for a bad reason -- and it reports
"the number changed" rather than which coverage was lost. Names fail with
exactly what went missing and need no maintenance when tests are added.

Verified in both directions: all five resolve against the current binary,
and a deliberately bogus name is reported and fails the step. The
whitespace strip matters -- the heredoc is indented for YAML, and without
it no name would ever match and the check would pass vacuously, which is
the same silent-success shape this is meant to prevent.

Fixes #58

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The check only printed on failure, so a pass that matched nothing looked
exactly like a pass that matched everything -- the same silent-success
shape the guard exists to catch, reintroduced in the guard itself. It now
echoes each match and fails if it verified zero names.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kmatzen
kmatzen merged commit a940d3c into main Jul 18, 2026
3 checks passed
@kmatzen
kmatzen deleted the ci/require-critical-tests branch July 18, 2026 23:44
kmatzen added a commit that referenced this pull request Jul 19, 2026
)

ctest reports pass/fail for the binary as a whole, and --output-on-failure
hides Catch2's summary on success, so a green build recorded nothing about
how many cases actually ran. A case that starts skipping stays present in
--list-tests (so the #65 guard misses it) and needs no fixture (so the #63
guard misses it too), yet exercises nothing.

That is not hypothetical: #70 was a completely broken FFV1 path hidden
behind exactly this, for however long it had been there.

Every codec these tests need is installed in CI, so a skip there is a real
gap rather than graceful degradation, and the check fails the build. It
uses the default console reporter deliberately -- --reporter compact omits
the skip count entirely, so the grep would never fire. Verified both
directions against real output: the line from a run with skips matches, the
current clean run does not.

Also bumps actions/checkout@v4 -> v5 and actions/setup-python@v5 -> v6
across all three workflows. Both target Node 20, which GitHub is currently
force-running on Node 24 behind a shim it calls temporary; when that goes
they break, for reasons unrelated to any change here.

And adds __pycache__/ to .gitignore, which has been dirtying git status
since the Python bindings landed.

Fixes #66, fixes #68

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Fixture-gated tests can vanish silently, same failure mode as #55

1 participant