Skip to content
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: calculate executed lines using source map #53315

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

MoLow
Copy link
Member

@MoLow MoLow commented Jun 3, 2024

Fixes #52775 (comment)
Supersedes #53153

before this fix, the lines that were actually executed were calculated using the source file on the disk - this is not the case when using ES loaders/transpilers.
since we don't need the actual code run we create fake lines with a dummy char, just to map the dummy line to its original source

@MoLow MoLow requested review from benjamingr and cjihrig June 3, 2024 22:15
@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 Jun 3, 2024
@khaosdoctor
Copy link
Member

Amazing work! Thanks a lot for this!

test/fixtures/test-runner/coverage-loader/hooks.mjs Outdated Show resolved Hide resolved
test/fixtures/test-runner/coverage-loader/sum.test.ts Outdated Show resolved Hide resolved
test/fixtures/test-runner/coverage-loader/sum.test.ts Outdated Show resolved Hide resolved
lib/internal/test_runner/coverage.js Outdated Show resolved Hide resolved
lib/internal/test_runner/coverage.js Outdated Show resolved Hide resolved
@MoLow MoLow requested a review from cjihrig June 4, 2024 05:19
@MoLow MoLow added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Jun 4, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 4, 2024
@nodejs-github-bot
Copy link
Collaborator

@MoLow MoLow added the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 4, 2024
@MoLow MoLow added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jun 5, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jun 5, 2024
@nodejs-github-bot nodejs-github-bot merged commit 419172f into nodejs:main Jun 5, 2024
62 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 419172f

@MoLow MoLow deleted the fix-source-map-original-lines branch June 6, 2024 05:34
RafaelGSS pushed a commit that referenced this pull request Jun 7, 2024
PR-URL: #53315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
@RafaelGSS RafaelGSS mentioned this pull request Jun 7, 2024
EliphazBouye pushed a commit to EliphazBouye/node that referenced this pull request Jun 20, 2024
PR-URL: nodejs#53315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
bmeck pushed a commit to bmeck/node that referenced this pull request Jun 22, 2024
PR-URL: nodejs#53315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
marco-ippolito pushed a commit that referenced this pull request Jul 19, 2024
PR-URL: #53315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
marco-ippolito pushed a commit that referenced this pull request Jul 19, 2024
PR-URL: #53315
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Experimental Test Coverage throws "cannot read properties of undefined (reading: line)"
6 participants