ci(cli-tri): count, name and ratchet the tests that skip themselves - #2378
Merged
Conversation
Three Lean smoke-gate tests skip on every runner and cli-tri is green. They do not use #[ignore] -- they println! a reason and return -- so libtest counts them as passed and the run reports "173 passed; 0 failed; 0 ignored". cargo test also captures the stdout of a passing test, so the reason never reaches the log: grep -icE 'skip' over the full default log returns 2, and both hits are test names, not reasons. Adds cli/tri/skipwatch.py, which parses the test log for tests that skip themselves, reports the count and reasons to $GITHUB_STEP_SUMMARY and a ::notice, and fails when the set GROWS. cli-tri.yml gains --nocapture (so the reason exists in the log) and --test-threads=1 (so it can be attributed to a test, since libtest lands it on the already-open "test NAME ... " line). cli/tri/skip-baseline.txt is emitted by skipwatch.py --emit-baseline from a real test log, not hand-written. A typed 3 would restate what is already known and would not survive a rename. Today's three skips are NOT turned into failures: that is a policy decision for the owner, and a skip is not a failure. No Lean toolchain is installed -- it is multi-gigabyte and unaffordable here -- so #2370 stays open for the real fix. Biting was demonstrated: a fourth deliberately-skipping test was planted in fpga::tests, cargo reported "172 passed; 2 failed; 0 ignored" (mutant counted as passed, ignored still zero), and the ratchet reported 4 against a baseline of 3, named it, and exited 1. The mutant was removed; fpga.rs is unchanged from master. Closes #2377 Reference #2370
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-08-22 01:01:52 UTC
Summary
Seal Status
|
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.
Closes #2377. #2370 stays open — this does not fix it.
What I verified first
Re-checked #2370's claims on
origin/masterc142c2f03802c13407649d521e64380b0c68c819before changing anything.git grep -niE "elan|lake|lean-toolchain|lean-action" origin/master -- .github/workflows/returns nothing. Every
leansubstring hit across the workflow files is a falsepositive —
boolean,clean,elaborated.cli-tri.yml's only install step is:The three skips reproduce verbatim, and the issue's list is exact:
The part that decided the design
None of the three uses
#[ignore]. Eachprintln!s a reason andreturns, so libtestcounts them as passed:
ignoredis0. Andcargo testcaptures the stdout of a passing test, so the reasonis not in the log at all —
grep -icE 'skip'over the full default log returns 2, andboth hits are test names (
..._sections_skipped ... ok,skipped_is_not_a_verdict_...), not reasons.So there is nothing to parse unless you ask for it.
--nocapturemakes the reason exist;--test-threads=1makes it attributable, because libtest lands the reason on thetest NAME ...line it has already opened and parallel workers interleave those.Shape: ratchet, not reporting-only
Reporting-only would detect nothing — it prints a number into a green run and a fourth
test could start skipping tomorrow with the notice quietly reading
4. The ratchet keepsthat reporting and fails on growth, which is the actual regression.
The baseline is emitted by the same script in
--emit-baselinemode from a real test log.It is not a hand-typed
3: that would restate what #2370 already established and wouldnot survive a rename.
Today's three skips are not turned into failures. That is the owner's policy call, and
a skip is not a failure.
Three bars
TRUE — reports the real set, exit 0:
ALIVE — it runs in the real pipeline. End-to-end with the exact committed command
sequence,
set -o pipefailcorrectly propagated a test failure throughtee(exit 101)while the ratchet still read the log and reported 3.
BITING — a fourth deliberately-skipping test was planted in
fpga::tests(skipping ona nonexistent binary) and the suite re-run.
cargo testsaid:The mutant counted as passed and
ignoredstayed 0 — that is the defect itself.The ratchet caught it:
Exit
1, reporting 4 rather than 3. The mutant was then removed;cli/tri/src/fpga.rsis byte-identical to master (git diffis empty).Degenerate inputs were checked too: a log with no
test result:line (build died) and amissing log both report "skip set NOT evaluated" and exit 0, rather than reporting an
empty set as a clean bill of health.
What this is not
elanplus a toolchain is multi-gigabyte andunaffordable on this machine (~1.1 GB free all session). The real fix for No workflow installs lake/elan, so every Lean smoke-gate test skips on every runner #2370 is that
install, and it is still undone — hence No workflow installs lake/elan, so every Lean smoke-gate test skips on every runner #2370 stays open.
legible and stops the set growing unnoticed.
SKIP:/skip:on a line oftest stdout. A test that returns early printing something else, or printing nothing, is
as invisible to this as it is today. Real hole, stated deliberately.
the ubuntu runner's set differs, the ratchet reddens on its first run rather than
passing quietly — the intended direction.
cli-tri'sbuild, which is not a required check, soauto-merge will not wait for it. It is watched on master after merge.