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: format coverage report for tap reporter #51119

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

pulkit-30
Copy link
Contributor

this PR enhances the tap coverage report output (similar to the spec reporter).

code:

import assert from "node:assert";
import { test } from "node:test";

test("some test", () => {
    assert.strictEqual(1,1)
})

before:

TAP version 13
# Subtest: some test
ok 1 - some test
  ---
  duration_ms: 1.008875
  ...
1..1
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 9.619875
# start of coverage report
# file | line % | branch % | funcs % | uncovered lines
# index.mjs | 100.00 | 100.00 | 100.00 | 
# all files | 100.00 | 100.00 | 100.00 |
# end of coverage report

now:

TAP version 13
# Subtest: some test
ok 1 - some test
  ---
  duration_ms: 1.41925
  ...
1..1
# tests 1
# suites 0
# pass 1
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 12.865292
# start of coverage report
# ----------------------------------------------------------
# file      | line % | branch % | funcs % | uncovered lines
# ----------------------------------------------------------
# index.mjs | 100.00 |   100.00 |  100.00 | 
# ----------------------------------------------------------
# all files | 100.00 |   100.00 |  100.00 |
# ----------------------------------------------------------
# end of coverage report

@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 labels Dec 11, 2023
Copy link
Member

@rluvaton rluvaton left a comment

Choose a reason for hiding this comment

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

I verified that this change still follows the tap specification and other tap parsers are working with this as well

Great job

test/parallel/test-runner-coverage.js Show resolved Hide resolved
@rluvaton rluvaton added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 11, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 11, 2023
@nodejs-github-bot
Copy link
Collaborator

@rluvaton rluvaton added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Dec 11, 2023
@nodejs-github-bot
Copy link
Collaborator

@debadree25 debadree25 added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 13, 2023
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Dec 13, 2023
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/51119
✔  Done loading data for nodejs/node/pull/51119
----------------------------------- PR info ------------------------------------
Title      test_runner: format coverage report for tap reporter (#51119)
Author     Pulkit Gupta  (@pulkit-30)
Branch     pulkit-30:tap-coverage -> nodejs:main
Labels     author ready, needs-ci, test_runner
Commits    2
 - test_runner: format coverage report for tap reporter
 - fix lint
Committers 1
 - pulkit-30 
PR-URL: https://github.com/nodejs/node/pull/51119
Reviewed-By: Raz Luvaton 
Reviewed-By: Luigi Pinca 
Reviewed-By: Moshe Atlow 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/51119
Reviewed-By: Raz Luvaton 
Reviewed-By: Luigi Pinca 
Reviewed-By: Moshe Atlow 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 11 Dec 2023 16:35:48 GMT
   ✔  Approvals: 3
   ✔  - Raz Luvaton (@rluvaton): https://github.com/nodejs/node/pull/51119#pullrequestreview-1776094670
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/51119#pullrequestreview-1776238268
   ✔  - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/51119#pullrequestreview-1776345233
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2023-12-12T12:11:28Z: https://ci.nodejs.org/job/node-test-pull-request/56246/
- Querying data for job/node-test-pull-request/56246/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 51119
From https://github.com/nodejs/node
 * branch                  refs/pull/51119/merge -> FETCH_HEAD
✔  Fetched commits as 228bc5c457a9..eb98b15f1352
--------------------------------------------------------------------------------
[main 787445b822] test_runner: format coverage report for tap reporter
 Author: pulkit-30 
 Date: Mon Dec 11 22:02:35 2023 +0530
 2 files changed, 20 insertions(+), 18 deletions(-)
[main e1358436fb] fix lint
 Author: pulkit-30 
 Date: Mon Dec 11 23:33:41 2023 +0530
 1 file changed, 2 insertions(+)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: format coverage report for tap reporter

PR-URL: #51119
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD caac4b4984] test_runner: format coverage report for tap reporter
Author: pulkit-30 pulkit30.bsr@gmail.com
Date: Mon Dec 11 22:02:35 2023 +0530
2 files changed, 20 insertions(+), 18 deletions(-)
Rebasing (3/4)
Rebasing (4/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fix lint

PR-URL: #51119
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com
Reviewed-By: Moshe Atlow moshe@atlow.co.il

[detached HEAD 2079f69752] fix lint
Author: pulkit-30 pulkit30.bsr@gmail.com
Date: Mon Dec 11 23:33:41 2023 +0530
1 file changed, 2 insertions(+)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/7198280065

@debadree25 debadree25 removed the commit-queue-failed An error occurred while landing this pull request using GitHub Actions. label Dec 15, 2023
@debadree25 debadree25 added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 15, 2023
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Dec 15, 2023
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/51119
✔  Done loading data for nodejs/node/pull/51119
----------------------------------- PR info ------------------------------------
Title      test_runner: format coverage report for tap reporter (#51119)
Author     Pulkit Gupta  (@pulkit-30)
Branch     pulkit-30:tap-coverage -> nodejs:main
Labels     author ready, needs-ci, test_runner
Commits    2
 - test_runner: format coverage report for tap reporter
 - fix lint
Committers 1
 - pulkit-30 
PR-URL: https://github.com/nodejs/node/pull/51119
Reviewed-By: Raz Luvaton 
Reviewed-By: Luigi Pinca 
Reviewed-By: Moshe Atlow 
Reviewed-By: Debadree Chatterjee 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/51119
Reviewed-By: Raz Luvaton 
Reviewed-By: Luigi Pinca 
Reviewed-By: Moshe Atlow 
Reviewed-By: Debadree Chatterjee 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Mon, 11 Dec 2023 16:35:48 GMT
   ✔  Approvals: 4
   ✔  - Raz Luvaton (@rluvaton): https://github.com/nodejs/node/pull/51119#pullrequestreview-1776094670
   ✔  - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/51119#pullrequestreview-1776238268
   ✔  - Moshe Atlow (@MoLow) (TSC): https://github.com/nodejs/node/pull/51119#pullrequestreview-1776345233
   ✔  - Debadree Chatterjee (@debadree25): https://github.com/nodejs/node/pull/51119#pullrequestreview-1783172811
   ✔  Last GitHub CI successful
   ℹ  Last Full PR CI on 2023-12-13T16:38:46Z: https://ci.nodejs.org/job/node-test-pull-request/56246/
- Querying data for job/node-test-pull-request/56246/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 51119
From https://github.com/nodejs/node
 * branch                  refs/pull/51119/merge -> FETCH_HEAD
✔  Fetched commits as 5ac658102d8f..eb98b15f1352
--------------------------------------------------------------------------------
[main 867deb34eb] test_runner: format coverage report for tap reporter
 Author: pulkit-30 
 Date: Mon Dec 11 22:02:35 2023 +0530
 2 files changed, 20 insertions(+), 18 deletions(-)
[main 43b7a78955] fix lint
 Author: pulkit-30 
 Date: Mon Dec 11 23:33:41 2023 +0530
 1 file changed, 2 insertions(+)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
test_runner: format coverage report for tap reporter

PR-URL: #51119
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com
Reviewed-By: Moshe Atlow moshe@atlow.co.il
Reviewed-By: Debadree Chatterjee debadree333@gmail.com

[detached HEAD dced0311b4] test_runner: format coverage report for tap reporter
Author: pulkit-30 pulkit30.bsr@gmail.com
Date: Mon Dec 11 22:02:35 2023 +0530
2 files changed, 20 insertions(+), 18 deletions(-)
Rebasing (3/4)
Rebasing (4/4)

Executing: git node land --amend --yes
--------------------------------- New Message ----------------------------------
fix lint

PR-URL: #51119
Reviewed-By: Raz Luvaton rluvaton@gmail.com
Reviewed-By: Luigi Pinca luigipinca@gmail.com
Reviewed-By: Moshe Atlow moshe@atlow.co.il
Reviewed-By: Debadree Chatterjee debadree333@gmail.com

[detached HEAD 95f42e504f] fix lint
Author: pulkit-30 pulkit30.bsr@gmail.com
Date: Mon Dec 11 23:33:41 2023 +0530
1 file changed, 2 insertions(+)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/7218561408

@debadree25 debadree25 added commit-queue Add this label to land a pull request using GitHub Actions. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Dec 15, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 15, 2023
@nodejs-github-bot nodejs-github-bot merged commit 452d29c into nodejs:main Dec 15, 2023
72 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 452d29c

RafaelGSS pushed a commit that referenced this pull request Dec 15, 2023
PR-URL: #51119
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
@RafaelGSS RafaelGSS mentioned this pull request Dec 15, 2023
@richardlau richardlau added the backport-requested-v20.x PRs awaiting manual backport to the v20.x-staging branch. label Mar 25, 2024
@richardlau
Copy link
Member

This doesn't land cleanly on v20.x-staging and will need a manual backport.

@atlowChemi
Copy link
Member

@richardlau backported in #52260

atlowChemi pushed a commit to atlowChemi/node that referenced this pull request Mar 29, 2024
PR-URL: nodejs#51119
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Apr 29, 2024
PR-URL: #51119
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Apr 29, 2024
PR-URL: #51119
Backport-PR-URL: #52260
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Apr 29, 2024
PR-URL: #51119
Backport-PR-URL: #52260
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
marco-ippolito pushed a commit that referenced this pull request Apr 29, 2024
PR-URL: #51119
Backport-PR-URL: #52260
Reviewed-By: Raz Luvaton <rluvaton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
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. backport-open-v20.x Indicate that the PR has an open backport backport-requested-v20.x PRs awaiting manual backport to the v20.x-staging branch. 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants