-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: delegate arbitrary output formatting to each reporter #48011
Comments
CC @nodejs/test_runner |
one thing that is TAP oriented and might be harder to change is the fact we direct any output on |
Hi @MoLow , Is anyone from test runner team working on it? Or is it open for anyone to try? |
@HinataKah0 I first want to gather feedback regarding this issue, then it makes sense to only work on it after #47867 lands |
I have discussed this with @cjihrig and he says it makes sense to him. |
I'll be happy to try 😄 |
I think it makes sense for the test runner to collect both stdout and stderr from the child processes and direct them to the same place. For example, if the reporter destination is a file, having stdout and stderr both sent to the file is helpful for reviewing the output at a later time. If stderr is not sent to the reporter destination, there would be no way of recovering it later. |
Introduce new `TestsStream` events `test:stderr` and `test:stdout` to delegate `stderr` and `stdout` (e.g. `console.log()`) formatting to the reporter. And patch existing reporters to: - Spec: output the message as it is - TAP: stay the same with existing `test:diagnostic` PR-URL: #48045 Fixes: #48011 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Introduce new `TestsStream` events `test:stderr` and `test:stdout` to delegate `stderr` and `stdout` (e.g. `console.log()`) formatting to the reporter. And patch existing reporters to: - Spec: output the message as it is - TAP: stay the same with existing `test:diagnostic` PR-URL: #48045 Fixes: #48011 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Introduce new `TestsStream` events `test:stderr` and `test:stdout` to delegate `stderr` and `stdout` (e.g. `console.log()`) formatting to the reporter. And patch existing reporters to: - Spec: output the message as it is - TAP: stay the same with existing `test:diagnostic` PR-URL: #48045 Fixes: #48011 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Introduce new `TestsStream` events `test:stderr` and `test:stdout` to delegate `stderr` and `stdout` (e.g. `console.log()`) formatting to the reporter. And patch existing reporters to: - Spec: output the message as it is - TAP: stay the same with existing `test:diagnostic` PR-URL: nodejs#48045 Fixes: nodejs#48011 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Introduce new `TestsStream` events `test:stderr` and `test:stdout` to delegate `stderr` and `stdout` (e.g. `console.log()`) formatting to the reporter. And patch existing reporters to: - Spec: output the message as it is - TAP: stay the same with existing `test:diagnostic` PR-URL: nodejs#48045 Fixes: nodejs#48011 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Introduce new `TestsStream` events `test:stderr` and `test:stdout` to delegate `stderr` and `stdout` (e.g. `console.log()`) formatting to the reporter. And patch existing reporters to: - Spec: output the message as it is - TAP: stay the same with existing `test:diagnostic` PR-URL: nodejs#48045 Fixes: nodejs#48011 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
What is the problem this feature will solve?
The current implementation of the test runner (
--test
) is very TAP oriented,so we have decided (#43525 (comment), #45618) to treat any arbitrary output as a test diagnostic.
I do agree this decision makes sense when using TAP as the reporter, but I think we can provide better DX for console logs or other arbitrary output when using other reporters.
What is the feature you are proposing to solve the problem?
add a new event emitted by
TestsStream
, perhapstest:stdout
ortest:unknown
(or whatever) so each reporter can decide how to treat unknown output.I think
console.log("test")
should show the same when runningnode --test-reporter spec test.js
andnode --test --test-reporter spec test.js
(probably also the same colors etc, but that probably justifies a separate issue)What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: