Repository navigation
test_runner: compute source-mapped line counts after merge - #68018
Open
prateeknitcse wants to merge 1 commit into
Open
prateeknitcse wants to merge 1 commit into
prateeknitcse wants to merge 1 commit into
Conversation
mapCoverageWithSourceMap() used to update line counts in the shared #sourceLines map while reading each process coverage file. When a source-mapped range started mid-line (such as after `export `), mapRangeToLines() later skipped that line in summary(), leaving whichever coverage file happened to be read last to set the count. Move source-mapped line count updates into summary() via mapRangeToLines() so counts are always derived from the merged ranges. Fixes: nodejs#67077 Signed-off-by: prateeksingh <prateeksingh010101@gmail.com>
Collaborator
|
Review requested:
|
Contributor
|
Caution AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #68018 +/- ##
==========================================
+ Coverage 90.58% 90.63% +0.05%
==========================================
Files 802 802
Lines 286915 287052 +137
Branches 55404 55486 +82
==========================================
+ Hits 259902 260180 +278
+ Misses 17100 16948 -152
- Partials 9913 9924 +11
🚀 New features to boost your workflow:
|
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: #67077
mapCoverageWithSourceMap()was mutating line counts in the shared#sourceLinesmap while reading each individual coverage file, beforemergeCoverage()finished combining them. BecausemapRangeToLines()insummary()skips lines that a range only covers partially (likeexport function add), whichever coverage file happened to be read last decided the count for that line.This removes the early per-file write in
mapCoverageWithSourceMap(), tracks source-mapped URLs onTestCoverage, and updates partial-line counts inmapRangeToLines()from the merged ranges duringsummary().I reproduced the issue locally and verified the updated
coverage.jslogic directly against captured V8 coverage payloads in both merge orders, plus ESLint on the two touched files. Relying on CI for the full binary test run since I haven't completed a local build ofmain.