test_runner: exclude ignored branches from coverage#61651
Open
Daniel-1600 wants to merge 1 commit intonodejs:mainfrom
Open
test_runner: exclude ignored branches from coverage#61651Daniel-1600 wants to merge 1 commit intonodejs:mainfrom
Daniel-1600 wants to merge 1 commit intonodejs:mainfrom
Conversation
When using /* node:coverage ignore next */ comments, branches where all lines are ignored were still being included in BRDA entries and counted in total branch count (BRF), even though lines were correctly excluded from DA entries. Skip branches entirely when all lines in the branch are ignored (range.ignoredLines === range.lines.length), matching the behavior of how ignored lines are excluded from line coverage. Before: BRDA:4,2,0,0 # ignored branch appears with count=0 BRF:3 # 3 total branches (including ignored) BRH:2 # 2 branches hit (66.67%) After: (no BRDA entry for ignored branch) BRF:2 # 2 total branches (ignored branch excluded) BRH:2 # 2 branches hit (100%) Refs: https://github.com/tobigumo/node-coverage-brda-bug
Collaborator
|
Review requested:
|
Member
|
There's a lot of unrelated changes |
Member
|
And tests are missing too |
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.
What I changed
Fixed an issue where
/* node:coverage ignore next */wasn't excludingbranches from coverage reports. Lines were being ignored correctly, but
branches pointing to those lines were still showing up as uncovered.
Now when all lines in a branch are ignored, the branch itself gets
skipped entirely from the BRDA entries.
Before:
BRDA:4,2,0,0After:
Fixes the issue reported in: https://github.com/tobigumo/node-coverage-brda-bug