Conversation
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.
Summary
Mutation collection currently swallows errors from both annotation scanning and mutant generation. If every changed file hits one of those errors,
Analyzesees zero mutants and reportsPASSwithNo mutants generated from changed code.This change propagates those collection errors instead, preserving the distinction between a genuine zero-mutant result and a failed mutation analysis.
Problem
collectMutantscurrently handles errors from both collection stages by continuing to the next file:If collection fails for all relevant files, the resulting mutant list is empty and
Analyzereports the mutation section as passing.This makes these two states indistinguishable:
Change
collectMutantsto return([]Mutant, error).Analyze.Tests
The regression test injects deterministic failures through a fake
lang.Languageimplementation and verifies thatAnalyzereturns an error wrapping the original cause.Before the fix, these cases are silently converted into a successful zero-mutant result.
After the fix, the original errors are propagated.
Design note
This PR uses fail-fast propagation because reporting
PASSloses the distinction between "no applicable mutants" and "mutation collection failed."If partial-results or warning behavior is preferred for individual file failures, I am happy to adjust the reporting policy while preserving that distinction.