Repository navigation
Conversation
A pattern such as pkg.mod.x_f__mutmut_* never matched the function-name keys in tests_by_mangled_function_name, so the clean-test step got an empty selection and ran the whole test suite. Match the pattern's function part instead. Fixes boxed#592
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
When running mutmut with a targeted pattern such as
pkg.mod.x_f__mutmut_*, the "Running clean tests" step can run the entire test suite instead of only the relevant tests. This can make targeted runs unnecessarily slow.Cause
The pattern includes the
__mutmut_*mutant suffix, but the clean-test selection logic matches patterns against function-name keys without that suffix. This can result in an empty test selection, causing pytest to run the entire suite.Fix
Match the pattern's function portion, before
__mutmut_, against the function-name keys when selecting clean tests.Selecting some additional relevant tests is safe for this sanity check: the goal is to verify that the relevant tests pass against the unmutated code. Running a few extra tests is preferable to selecting no tests and accidentally running the entire suite.
Tests
test_gran once before the fix and zero times after it during a targeted run off's mutants.Fixes #592