Repository navigation
Conversation
The before/after counters iterated the keys of tests_by_mangled_function_name, so they measured the length of each mangled function name instead of the size of its test set. The dict comprehension between them keeps every key, so both sums were always equal, the "Removed N obsolete test names" message never printed and save_stats() never ran from here. Obsolete node IDs therefore stayed in mutants/mutmut-stats.json indefinitely, even though the in-memory filtering worked. Count the test sets instead, and add a unit test that checks the cleanup reaches the stats file. Fixes #564
Collaborator
|
we'll merge with #569 |
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.
Fixes #564.
count_beforeandcount_afterinListAllTestsResult.clear_out_obsolete_test_namesiterated the keys oftests_by_mangled_function_name, so they summed the lengths of the mangled names rather than the sizes of the test sets. Since the comprehension in between keeps every key, the two sums were always equal, the "Removed N obsolete test names" message never printed andsave_stats()never ran from here. The in-memory filtering worked, but obsolete node IDs stayed inmutants/mutmut-stats.jsonforever.This counts the test sets instead and adds a unit test that drives the real
save_stats()into a tmp dir and checks the cleanup reaches the file (plus one for the no-op case). The code moved from__main__.pytorunners/harness.pyin #561, but is otherwise unchanged from the issue.