FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

test_runner: throw on invalid source map by avivkeller · Pull Request #55055 · nodejs/node · GitHub

/ node Public

test_runner: throw on invalid source map - #55055

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
avivkeller:test-runner-throw-invalid-source-map
Oct 6, 2024
Merged

test_runner: throw on invalid source map#55055
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
avivkeller:test-runner-throw-invalid-source-map

Conversation

avivkeller commented Sep 21, 2024
edited
Loading

Copy link
Copy Markdown
Member

This PR changes the code coverage test runner to throw ERR_SOURCE_MAP_CORRUPT when a sourcemap is not a valid JSON file, or does not exist.

avivkeller requested a review from cjihrig September 21, 2024 21:00

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Sep 21, 2024

codecov Bot commented Sep 21, 2024
edited
Loading

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.41%. Comparing base (8de2695) to head (87af23b).
Report is 290 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/coverage.js 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #55055      +/-   ##
==========================================
- Coverage   88.41%   88.41%   -0.01%     
==========================================
  Files         652      652              
  Lines      186576   186579       +3     
  Branches    36049    36049              
==========================================
- Hits       164960   164955       -5     
- Misses      14889    14900      +11     
+ Partials     6727     6724       -3     
Files with missing lines Coverage Δ
lib/internal/errors.js 96.98% <100.00%> (+<0.01%) ⬆️
lib/internal/test_runner/coverage.js 64.65% <50.00%> (-0.05%) ⬇️

... and 35 files with indirect coverage changes

Comment thread lib/internal/test_runner/coverage.js Outdated
avivkeller requested a review from cjihrig September 22, 2024 20:57

avivkeller commented Sep 22, 2024
edited
Loading

Copy link
Copy Markdown
Member Author

The first commit is #55037, which will land shortly. This PR adds ERR_SOURCE_MAP_CANNOT_PARSE for when the source map does not exist / is not valid JSON

avivkeller added 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. source maps Issues and PRs related to source map support. labels Sep 22, 2024

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

cjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please stop changing unrelated things in PRs. It makes PRs more difficult to review and is more likely to introduce issues. If you feel strongly that the source map fixtures should be renamed, please do that in a separate PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

You shouldn't need the awaits on the tests.

Comment thread lib/internal/test_runner/coverage.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'm a bit torn on this error for a couple of reasons:

  • The error says that the source map does not exist or cannot be parsed... but there is still an entry for it in the source map cache.
  • The fact that this error is about source maps, but it is only thrown from the test runner even though there is other source map functionality in core.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The error says that the source map does not exist or cannot be parsed... but there is still an entry for it in the source map cache.

There is an entry, but it's empty.


Before this change, an error was thrown because the entry was empty, and therefore didn't have any properties. Does that error get thrown anywhere else? If so, I can try and handle them as well

avivkeller commented Sep 24, 2024
edited
Loading

Copy link
Copy Markdown
Member Author

Please stop changing unrelated things in PRs. It makes PRs more difficult to review and is more likely to introduce issues. If you feel strongly that the source map fixtures should be renamed, please do that in a separate PR.

IMO it's related because this adds tests, and moving them into their own file is good for decluttering, but I'll move it feel it's unrelated.

Comment thread lib/internal/test_runner/coverage.js Outdated
avivkeller added blocked PRs that are blocked by other issues or PRs. and removed commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. labels Sep 30, 2024
avivkeller removed the blocked PRs that are blocked by other issues or PRs. label Oct 3, 2024
avivkeller requested review from MoLow and cjihrig October 6, 2024 18:06
cjihrig added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 6, 2024
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 6, 2024

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

cjihrig removed the needs-ci PRs that need a full CI run. label Oct 6, 2024
cjihrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 6, 2024
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 6, 2024
nodejs-github-bot merged commit 9a9409f into nodejs:main Oct 6, 2024

Copy link
Copy Markdown
Collaborator

Landed in 9a9409f

aduh95 pushed a commit that referenced this pull request Oct 9, 2024
PR-URL: #55055
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
aduh95 mentioned this pull request Oct 9, 2024
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

Labels

coverage Issues and PRs related to native coverage support. errors Issues and PRs related to JavaScript errors originated in Node.js core. source maps Issues and PRs related to source map support. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL