-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
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. |
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
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. |
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: