Skip to content

Test reporter#56438

Merged
nodejs-github-bot merged 10 commits into
nodejs:mainfrom
Ceres6:test-reporter
Jan 11, 2025
Merged

Test reporter#56438
nodejs-github-bot merged 10 commits into
nodejs:mainfrom
Ceres6:test-reporter

Conversation

@Ceres6
Copy link
Copy Markdown
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
Copy Markdown
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
@codecov
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Ceres6 commented Jan 4, 2025

Sure, I can open the PR

@cjihrig
Copy link
Copy Markdown
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.

Comment thread test/parallel/test-runner-cli-concurrency.js Outdated
@Ceres6
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@MoLow
Copy link
Copy Markdown
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