Repository navigation
fix(mutation): fail the gate when tests fail without any mutation - #15
Open
kamuikatsurgi wants to merge 1 commit into
Open
kamuikatsurgi wants to merge 1 commit into
kamuikatsurgi wants to merge 1 commit into
Conversation
A package whose tests failed unmutated had all its mutants reported as "not run (budget or cancelled)" and the run still exited 0. Such mutants now get their own outcome, baseline_failed, which is named in the summary and findings and fails a gating tier. A single failing test no longer costs the package its other tests: it is retried once, then left out and named, and only the mutants no passing test reaches are reported as untested.
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.
Problem
If a package's tests fail before any mutation is applied, diffguard dropped every mutant of that package, reported them as
NOT RUN (budget or cancelled)and still exited 0. The only trace was a line on stderr. Seen running locally on bor, where oneminertest fails on the machine:A local exit 0 could hide a whole package, and any package with a flaky or environment-dependent test would get the same treatment in CI. The fallback also ran the full suite once more only to fail again.
Changes
baseline_failedfor mutants whose tests fail without any mutation. It is excluded from the score, shown in the summary asN NOT TESTED (their tests fail without any mutation), and listed as one finding per file.baseline_failedonly if no passing test reaches it and a left-out test does.Behaviour to be aware of
Testing
make build,make testpass../diffguard .exits 0: complexity max 8, T1 90.5% (19/21), T2 100% (8/8).TestSession_FailingTestIsLeftOut,TestBuildSection_BaselineFailedFailsTheGate;TestSession_FailingBaselineRunsNothingandTestSession_TestsThatDoNotCompileRunNothingnow expectbaseline_failed.