test_runner: delegate stderr and stdout formatting to reporter#48045
test_runner: delegate stderr and stdout formatting to reporter#48045nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
|
Review requested:
|
lib/internal/test_runner/runner.js
Outdated
| __proto__: null, | ||
| type: 'test:diagnostic', | ||
| type: 'test:stdout', | ||
| data: { __proto__: null, nesting: 0, file: this.name, message }, |
There was a problem hiding this comment.
as you have mentioned, nesting is redundant here.
also, I think we should stop breaking this into lines and delegate that to the TAP reporter (and leave as is in spec reporter) - but that dosnt have to happen in this PR
There was a problem hiding this comment.
I think we should stop breaking this into lines and delegate that to the TAP reporter (and leave as is in spec reporter)
Sorry I don't get the spec reporter part. By "leaving as it is" are you referring to printing \n as \\n?
There was a problem hiding this comment.
Sorry I don't get the spec reporter part. By "leaving as it is" are you referring to printing \n as \n?
I was referring to the output being split into lines before passing it to the reporter:
node/lib/internal/test_runner/runner.js
Line 283 in 3473edc
but as written, it is also ok to not include it in this PR
There was a problem hiding this comment.
I'll address it in separate PR 👍
6e503ca to
3473edc
Compare
I think TAP should stay the same as today, and spec should just pipe the original data. that is the goal |
3473edc to
16f1020
Compare
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`
16f1020 to
67f3543
Compare
| ### Event: `'test:stderr'` | ||
|
|
||
| * `data` {Object} | ||
| * `file` {string} The path of the test file. |
There was a problem hiding this comment.
For the test:diagnostic event, this can also be undefined. Is that possible for these new events?
There was a problem hiding this comment.
no. test:diagnostic can be produced inside the REPL. these new events are only useful with --test
|
Landed in 1229a22 |
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>

Introduce new
TestsStreameventstest:stderrandtest:stdoutto delegate
stderrandstdout(e.g.console.log()) formattingto the reporter. And patch existing reporters to:
test:diagnosticFixes: #48011