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 reporter #56438

Merged
merged 10 commits into from
Jan 11, 2025
Merged

Test reporter #56438

merged 10 commits into from
Jan 11, 2025

Conversation

Ceres6
Copy link
Contributor

@Ceres6 Ceres6 commented Jan 2, 2025

Building on top of #52189

This commit introduces a node:test reporter to the common utils. This reporter can be used to silence output other than errors from node:test. This is useful because in Node's own test suite, the output of node:test is included in the output of the Python test runner.

Refs: #49120

Rebased with main to fix conflicts and added FAIL_FAST envvar.

cc @cjihrig @JakobJingleheimer

This commit introduces a node:test reporter to the common utils.
This reporter can be used to silence output other than errors
from node:test. This is useful because in Node's own test suite,
the output of node:test is included in the output of the
Python test runner.

Refs: nodejs#49120
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/actions
  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. labels Jan 2, 2025
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.17%. Comparing base (98d4ebc) to head (4547f09).
Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56438      +/-   ##
==========================================
+ Coverage   88.53%   89.17%   +0.63%     
==========================================
  Files         657      662       +5     
  Lines      190741   191745    +1004     
  Branches    36607    36906     +299     
==========================================
+ Hits       168881   170988    +2107     
+ Misses      15036    13616    -1420     
- Partials     6824     7141     +317     

see 122 files with indirect coverage changes

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 3, 2025

I kept the failing test so the output can be seen. I will remove it once we agree that output is good enough

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.

Personally, this seems fine to me. We can also iterate on it pretty quickly since it's internal only. I'm not sure if I can sign off on this or not since I'm the original author, but throwing my LGTM here.

Also, we'll have to remove that intentional failure before landing.

On a side note, I definitely think we (you?) should open another PR to get rid of the GitHub reporter. It generates far too much output noise.

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 4, 2025

Sure, I can open the PR

@cjihrig
Copy link
Contributor

cjihrig commented Jan 7, 2025

This is what the output currently looks like:

::debug::starting to run default concurrency
::debug::completed running default concurrency
::debug::starting to run concurrency of one
::debug::completed running concurrency of one
::debug::starting to run concurrency of two
::error title=concurrency of two,file=node/node/test/parallel/test-runner-cli-concurrency.js,line=26,col=9::[Error [ERR_TEST_FAILURE]: bye] {
  code: 'ERR_TEST_FAILURE',
  failureType: 'testCodeFailure',
  cause: Error: bye
      at TestContext.<anonymous> (/home/runner/work/node/node/node/test/parallel/test-runner-cli-concurrency.js:26:9)
      at Test.runInAsyncScope (node:async_hooks:211:14)
      at Test.run (node:internal/test_runner/test:931:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:629:18)
      at Test.postRun (node:internal/test_runner/test:1042:19)
      at Test.run (node:internal/test_runner/test:970:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:629:7)
}
Test failure: 'concurrency of two'
Location: test/parallel/test-runner-cli-concurrency.js:22:1
Error: bye
    at TestContext.<anonymous> (/home/runner/work/node/node/node/test/parallel/test-runner-cli-concurrency.js:26:9)
    at Test.runInAsyncScope (node:async_hooks:211:14)
    at Test.run (node:internal/test_runner/test:931:25)
    at Test.processPendingSubtests (node:internal/test_runner/test:629:18)
    at Test.postRun (node:internal/test_runner/test:1042:19)
    at Test.run (node:internal/test_runner/test:970:12)
    at async Test.processPendingSubtests (node:internal/test_runner/test:629:7)

::debug::starting to run isolation=none uses a concurrency of one
::debug::completed running isolation=none uses a concurrency of one
::debug::starting to run isolation=none overrides --test-concurrency
::debug::completed running isolation=none overrides --test-concurrency
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::tests 5
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::suites 0
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::pass 4
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::fail 1
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::cancelled 0
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::skipped 0
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::todo 0
::notice file=node/test/parallel/test-runner-cli-concurrency.js,line=1,col=1::duration_ms 1478.484154
::group::Test results (4 passed, 1 failed)
::notice::
::endgroup::

All of the lines starting with :: will go away once #56468 lands.

@Ceres6 can you remove the intentionally failing test now so that we can progress towards landing this.

@Ceres6
Copy link
Contributor Author

Ceres6 commented Jan 7, 2025

@cjihrig done!

@pmarchini pmarchini added 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 Jan 7, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 7, 2025
@nodejs-github-bot
Copy link
Collaborator

@MoLow
Copy link
Member

MoLow commented Jan 7, 2025

this will remove all the GitHub annotations (like the ones in the screenshot) on the failed files - is that intended? those seem pretty useful to me
image
image

@cjihrig
Copy link
Contributor

cjihrig commented Jan 7, 2025

@MoLow it is intentional. See #56438 (comment). I pinged you in #52189 (comment) as well.

Is it possible to make the GitHub reporter stop printing to stdout? If it is possible, I'd love to keep the GitHub annotations.

@MoLow
Copy link
Member

MoLow commented Jan 7, 2025

Is it possible to make the GitHub reporter stop printing to stdout? If it is possible, I'd love to keep the GitHub annotations.

I'l take a look, sure

test/common/test-error-reporter.js Outdated Show resolved Hide resolved
test/parallel/test-runner-error-reporter.js Outdated Show resolved Hide resolved
test/parallel/test-runner-error-reporter.js Outdated Show resolved Hide resolved
@cjihrig cjihrig added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 10, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 10, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@cjihrig cjihrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. and removed needs-ci PRs that need a full CI run. labels Jan 11, 2025
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 11, 2025
@nodejs-github-bot nodejs-github-bot merged commit 0576deb into nodejs:main Jan 11, 2025
65 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 0576deb

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. meta Issues and PRs related to the general management of the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants