Skip to content

test_runner: fix coverage report when --enable-source-maps is provided - #55228

Merged
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
geeksilva97:issue-55106
Oct 8, 2024
Merged

test_runner: fix coverage report when --enable-source-maps is provided#55228
nodejs-github-bot merged 3 commits into
nodejs:mainfrom
geeksilva97:issue-55106

Conversation

@geeksilva97

@geeksilva97geeksilva97 commented Oct 1, 2024

Copy link
Copy Markdown
Contributor

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test_runner Issues and PRs related to the test runner subsystem. labels Oct 1, 2024
@avivkeller

Copy link
Copy Markdown
Member

I bring with me my concerns from the other PR, but I'm curious what others think

@geeksilva97geeksilva97 changed the title Issue 55106test_runner: fix coverage report when --enable-source-maps is provideOct 1, 2024
@geeksilva97geeksilva97 changed the title test_runner: fix coverage report when --enable-source-maps is providetest_runner: fix coverage report when --enable-source-maps is providedOct 1, 2024
@geeksilva97

Copy link
Copy Markdown
ContributorAuthor

I bring with me my concerns from the other PR, but I'm curious what others think

Now I see what you meant. I will dig into it.

Comment threadlib/internal/test_runner/test.js Outdated
Comment threadtest/parallel/test-runner-coverage-source-map.js Outdated
@codecov

codecovBot commented Oct 5, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (deb5eff) to head (6391e6e).
Report is 19 commits behind head on main.

Files with missing linesPatch %Lines
lib/internal/test_runner/coverage.js44.44%15 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #55228 +/- ##
==========================================
- Coverage 88.41% 88.40% -0.02% 
==========================================
Files 652 652 Lines 186756 186785 +29 Branches 36100 36101 +1 ==========================================
- Hits 165126 165119 -7 - Misses 14906 14931 +25 - Partials 6724 6735 +11 
Files with missing linesCoverage Δ
lib/internal/test_runner/coverage.js63.82% <44.44%> (-0.83%)⬇️

... and 33 files with indirect coverage changes

@geeksilva97

Copy link
Copy Markdown
ContributorAuthor

Codecov Report

Attention: Patch coverage is 44.44444% with 15 lines in your changes missing coverage. Please review.

Project coverage is 88.40%. Comparing base (98788da) to head (c0deb06).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/test_runner/coverage.js 44.44% 15 Missing ⚠️
Additional details and impacted files

@@ Coverage Diff @@## main #55228 +/- ##
==========================================
+ Coverage 87.89% 88.40% +0.51% 
==========================================
Files 652 652 Lines 186589 186638 +49 Branches 35750 36054 +304 ==========================================
+ Hits 163999 165003 +1004 + Misses 15816 14904 -912 + Partials 6774 6731 -43 

Files with missing lines Coverage Δ
lib/internal/test_runner/coverage.js63.86% <44.44%> (-0.83%) ⬇️
... and 96 files with indirect coverage changes

how's this possible?

@avivkeller

Copy link
Copy Markdown
Member

how's this possible?

In my experience, codecov isn't always exactly accurate. Regardless, it's nothing to be concerned about.

@avivkelleravivkeller 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. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Oct 6, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 6, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@geeksilva97

geeksilva97 commented Oct 7, 2024

Copy link
Copy Markdown
ContributorAuthor

EDIT: on CI, mine fails. Not sure what caused that.

If you can reproduce the failure locally, it might help to have it log the output to see what the actual difference is.

It's the assertion on stdout

TAP version 13
# Subtest: /Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/invalid-json/index.js
ok 1 - /Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/invalid-json/index.js
---
duration_ms: 38.544167
...
1..1
# Warning: Could not report code coverage. TypeError: Cannot read properties of null (reading 'sourcesContent')
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 43.42

this message is not being printed.


When I run ./node --test --experimental-test-coverage --test-reporter tap test/fixtures/test-runner/source-maps/missing-sources/index.js it prints the message though.

TAP version 13
# Subtest: test/fixtures/test-runner/source-maps/missing-sources/index.js
ok 1 - test/fixtures/test-runner/source-maps/missing-sources/index.js
---
duration_ms: 301.77525
...
1..1
# Warning: Could not report code coverage. Error [ERR_SOURCE_MAP_MISSING_SOURCE]: Cannot find 'file:///Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/missing-sources/nonexistent.js' imported from the source map for 'file:///Users/edysilva/projects/contributions/node/test/fixtures/test-runner/source-maps/missing-sources/index.js'
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 305.851208

Sorry @redyetidev . Newbie working. I think I need to recompile

@avivkeller

Copy link
Copy Markdown
Member

Try rebasing to include your other PR?

@marco-ippolitomarco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 8, 2024
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 8, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@atlowChemiatlowChemi added the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 8, 2024
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Oct 8, 2024
@nodejs-github-bot
nodejs-github-bot merged commit 3a42085 into nodejs:mainOct 8, 2024
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in 3a42085

@cjihrig

Copy link
Copy Markdown
Contributor

This Refs two issues. Does it actually fix either/both of them?

@geeksilva97

geeksilva97 commented Oct 8, 2024

Copy link
Copy Markdown
ContributorAuthor

This Refs two issues. Does it actually fix either/both of them?

I'd say yes. I'm pretty sure it solves #54753. Could you confirm for #55106@redyetidev ?

@avivkeller

avivkeller commented Oct 8, 2024

Copy link
Copy Markdown
Member

There aren't any tests to confirm that, can you no longer reproduce the errors described? I would assume your other PR fixes that one

Comment threadtest/parallel/test-runner-coverage-source-map.js
aduh95 pushed a commit that referenced this pull request Oct 9, 2024
PR-URL: #55228
Refs: #55106
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
@aduh95aduh95 mentioned this pull request Oct 9, 2024
@aduh95aduh95 added dont-land-on-v18.x dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Oct 9, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.dont-land-on-v22.xPRs that should not land on the v22.x-staging branch and should not be released in v22.x.needs-ciPRs that need a full CI run.test_runnerIssues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@geeksilva97@nodejs-github-bot@avivkeller@cjihrig@MoLow@atlowChemi@aduh95@marco-ippolito