Repository navigation
Conversation
sferik
requested changes
Apr 3, 2026
sferik
left a comment
Collaborator
There was a problem hiding this comment.
I have a bit of feedback but I like the idea!
Files added via `track_files` that are never loaded/required reported 100% branch coverage because `SimulateCoverage` returns empty branch data, resulting in 0 covered / 0 missed = 100%. Add a `loaded` flag to `SourceFile` (passed via `add_not_loaded_files`) and use a `not_applicable` state in `CoverageStatistics` to report 0% instead of misleading 100% for files that were never loaded. This avoids faking raw counts while still producing the correct percentage. Fixes #902
Contributor
Author
|
Addressed your feedback — thanks @sferik!
Force-pushed as a single commit. Known limitation: The |
sferik
approved these changes
Apr 3, 2026
sferik
left a comment
Collaborator
There was a problem hiding this comment.
Much better! I’m going to merge this. Thanks again!
Contributor
Author
|
Thank you for the thorough review and quick merge, @sferik! Your feedback on avoiding faked counts and using instance-level flags made the solution much cleaner. Happy to follow up on the serialization limitation if needed. |
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 #902
Problem
Files added via
track_filesthat are never loaded/required report 100% branch coverage becauseSimulateCoveragereturns empty branch data, resulting in 0 covered / 0 missed = 100%.Solution
Add a
not_loadedflag toSimulateCoverageoutput and check it inSourceFile#branch_coverage_statistics(andmethod_coverage_statistics) to report 0% instead of misleading 100% for files that were never loaded.This follows the approach suggested by @PragTob in #902: