Skip to content

Conversation

avivkeller
Copy link
Member

@avivkeller avivkeller commented Sep 21, 2024

Ref: #54753 (comment) (CC @MoLow @cjihrig)
Ref: #55106

Coverage is currently an experimental feature, so this is non-breaking, right?

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Sep 21, 2024
@avivkeller avivkeller added coverage Issues and PRs related to native coverage support. source maps Issues and PRs related to source map support. labels Sep 21, 2024
Copy link

codecov bot commented Sep 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.37%. Comparing base (2cec716) to head (2b86de9).
Report is 20 commits behind head on main.

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     
Files with missing lines Coverage Δ
lib/internal/test_runner/coverage.js 70.56% <100.00%> (+5.78%) ⬆️
lib/internal/test_runner/test.js 96.94% <100.00%> (+<0.01%) ⬆️

... and 44 files with indirect coverage changes

@avivkeller avivkeller requested review from MoLow and cjihrig September 21, 2024 13:28
Copy link
Contributor

@cjihrig cjihrig left a 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.

@avivkeller avivkeller force-pushed the sourcemap-flag-coverage branch from a478463 to 2b633da Compare September 21, 2024 18:25
@avivkeller avivkeller requested a review from cjihrig September 21, 2024 18:25
@avivkeller avivkeller force-pushed the sourcemap-flag-coverage branch from 2b633da to 859e684 Compare September 21, 2024 19:55
@avivkeller avivkeller requested a review from cjihrig September 21, 2024 19:55
Copy link
Contributor

@cjihrig cjihrig left a 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.

@avivkeller avivkeller force-pushed the sourcemap-flag-coverage branch from 859e684 to 99c8881 Compare September 22, 2024 19:03
@avivkeller avivkeller added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label Sep 22, 2024
@avivkeller avivkeller force-pushed the sourcemap-flag-coverage branch from 99c8881 to 5f49e0e Compare September 22, 2024 20:13
@avivkeller avivkeller requested a review from cjihrig September 22, 2024 20:13

if (this.config.sourceMaps === true) {
// TODO(RedYetiDev): This should be supported with code coverage
if (this.config.sourceMaps && !this.config.coverage) {
Copy link
Member Author

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.

@avivkeller avivkeller force-pushed the sourcemap-flag-coverage branch from 235013d to 2b86de9 Compare September 22, 2024 20:22
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@avivkeller avivkeller added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Sep 22, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 22, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@cjihrig cjihrig left a 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

@avivkeller avivkeller added wip Issues and PRs that are still a work in progress. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Sep 22, 2024
@avivkeller avivkeller closed this Sep 22, 2024
@avivkeller
Copy link
Member Author

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

@avivkeller avivkeller reopened this Sep 24, 2024
@avivkeller
Copy link
Member Author

avivkeller commented Sep 24, 2024

After looking into it, the correct behavior is NOT that of --enable-source-maps See #55106.

@avivkeller avivkeller closed this Sep 24, 2024
@avivkeller
Copy link
Member Author

(didn't mean to re-open, just to comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. coverage Issues and PRs related to native coverage support. needs-ci PRs that need a full CI run. source maps Issues and PRs related to source map support. test_runner Issues and PRs related to the test runner subsystem. wip Issues and PRs that are still a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants