-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_runner: require --enable-source-maps
for source map coverage
#55039
Conversation
Review requested:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55039 +/- ##
==========================================
+ Coverage 88.23% 88.37% +0.13%
==========================================
Files 652 652
Lines 183911 184618 +707
Branches 35858 36636 +778
==========================================
+ Hits 162271 163148 +877
+ Misses 14916 14776 -140
+ Partials 6724 6694 -30
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test case.
a478463
to
2b633da
Compare
2b633da
to
859e684
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there are relevant CI failures.
859e684
to
99c8881
Compare
99c8881
to
5f49e0e
Compare
@@ -552,7 +552,8 @@ class Test extends AsyncResource { | |||
file: loc[2], | |||
}; | |||
|
|||
if (this.config.sourceMaps === true) { | |||
// TODO(RedYetiDev): This should be supported with code coverage | |||
if (this.config.sourceMaps && !this.config.coverage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Note When Code Coverage is enabled, the source map is loaded in the coverage constructor, and this statement messes up the lines. Not quite sure why, but skipping it has no negative impact.
235013d
to
2b86de9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes here are not correct and I am not comfortable landing this with comments like https://github.com/nodejs/node/pull/55039/files#r1770627388.
With these changes, this test is now broken if you run with --experimental-test-coverage
. The failing test's location should be test/fixtures/test-runner/output/source_mapped_locations.ts:5:1
, but these changes cause it to be test/fixtures/test-runner/output/source_mapped_locations.mjs:4:1
if coverage is enabled.
./node --enable-source-maps test/fixtures/test-runner/output/source_mapped_locations.mjs
As at @cjihrig mentioned above, there are a lot of kinks to work out with this change, so I'm going to close this PR while I figure out the best approach to this change. Thank you for your reviews |
After looking into it, the correct behavior is NOT that of |
(didn't mean to re-open, just to comment) |
Ref: #54753 (comment) (CC @MoLow @cjihrig)
Ref: #55106
Coverage is currently an experimental feature, so this is non-breaking, right?