-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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: add error only reporter for node:test #52189
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
If you push the artificial error to your branch, we could try running a node-stress-single-test CI with a single run to validate how Jenkins would parse the test failure. |
@aduh95 pushed |
Unfortunately, the Jenkins output is still not great and doesn't show the actual failure: https://ci.nodejs.org/job/node-stress-single-test/479/nodes=rhel8-x64/testReport/junit/(root)/parallel/test_runner_cli_concurrency/ EDIT: see comments below, that's not actually related to |
Interesting. Do you know how that is rendered. I was targeting the output in https://ci.nodejs.org/job/node-stress-single-test/479/nodes=rhel8-x64/console, which does look much better. But it would be nice to fix https://ci.nodejs.org/job/node-stress-single-test/479/nodes=rhel8-x64/testReport/junit/(root)/parallel/test_runner_cli_concurrency/. |
It looks like Jenkins cuts the "stacktrace" when it encounters |
Is this just a general problem not related to the use of
EDIT: This seems to be related to tap2junit I think. |
I think that's a tap2junit issue? Those Jenkins pages used to have the failure output in the "Stacktrace" box. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, I think this would be a nice addition
const output = [ | ||
`Test failure: '${name}'`, | ||
]; | ||
|
||
if (file) { | ||
output.push(`Location: ${relative(cwd, file)}:${line}:${column}`); | ||
} | ||
|
||
output.push(inspect(error)); | ||
output.push('\n'); | ||
yield output.join('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not yield
the values directly, instead of having the output
value?
Now that nodejs/tap2junit#54 has landed, what are the next steps to seeing it working in Jenkins? |
it needs to be released and the updated in all the ci machines CC @nodejs/build @cclauss |
@cjihrig nodejs/build#3761 is now deployed. should this PR be closed? |
Unsure. That PR was blocking me from evaluating this PR in the CI to see if it could be beneficial. |
So this still doesn't seem to work with the view in https://ci.nodejs.org/job/node-stress-single-test/514/nodes=rhel8-x64/testReport/junit/(root)/parallel/test_runner_cli_concurrency/, and I don't know what needs to happen to appease tap2junit (both with and without the change in this PR). The console output (shown in the OP) is still significantly better IMO. |
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
1d2aa53
to
5c7e4bf
Compare
@MoLow I'm interested in replacing the spec reporter with the less verbose one from this PR inside of GitHub Actions runs. However, it looks like the GitHub reporter is also sending output to stdout:
Is it possible to leverage the GitHub reporter for its annotations without it also logging things? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #52189 +/- ##
==========================================
+ Coverage 88.04% 88.54% +0.50%
==========================================
Files 657 657
Lines 190290 190290
Branches 36245 36540 +295
==========================================
+ Hits 167536 168488 +952
+ Misses 15893 14971 -922
+ Partials 6861 6831 -30 |
Sigh. It looks like the GitHub Actions toolkit writes directly to |
@JakobJingleheimer this might be something of interest to you. |
Awesome, this is a great idea! Do you need/want help finishing it? |
Help would definitely be welcomed. There are a few things left:
|
Opening as a draft to determine if this is a desirable change.
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
A comparison of output before and after this change is shown below. The TAP reporter is shown for the current output. The output is generated by
./tools/test.py test/parallel/test-runner-cli-concurrency.js
with an artificial error introduced.Before:
After: