GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — test_runner: remove stdout and stderr from error by cjihrig · Pull Request #45592 · nodejs/node Conversation
Contributor
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred.
targos
approved these changes
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
From my testing stderr shows up as TAP comments because the child process stderr is (incorrectly) piped into the TAP parser. I also have a follow up PR that stops stderr from being piped to the parser and instead just interprets the lines of stderr as unknown TAP tokens (diff below) - I just have to write a test for it. diff --git a/lib/internal/test_runner/runner.js b/lib/internal/test_runner/runner.js index 3f7134c6cd..eb73a46e55 100644 --- a/lib/internal/test_runner/runner.js +++ b/lib/internal/test_runner/runner.js @@ -246,16 +246,25 @@ function runTestFile(path, root, inspectPort, filesWatcher) { rl.on('line', (line) => { if (isInspectorMessage(line)) { process.stderr.write(line + '\n'); + return; } + + // stderr cannot be treated as TAP, per the spec. However, we want to + // surface stderr lines as TAP diagnostics to improve the DX. Inject + // each line into the test output as an unknown token as if it came + // from the TAP parser. + const node = { + kind: TokenKind.UNKNOWN, + node: { + value: line, + }, + }; + + subtest.addToReport(node); }); } const parser = new TapParser(); - child.stderr.pipe(parser).on('data', (ast) => { - if (ast.lexeme && isInspectorMessage(ast.lexeme)) { - process.stderr.write(ast.lexeme + '\n'); - } - }); child.stdout.pipe(parser).on('data', (ast) => { subtest.addToReport(ast); diff --git a/lib/internal/util/inspector.js b/lib/internal/util/inspector.js index 038479b173..c7f18ffdb6 100644 --- a/lib/internal/util/inspector.js +++ b/lib/internal/util/inspector.js @@ -16,7 +16,7 @@ const { validatePort } = require('internal/validators'); const kMinPort = 1024; const kMaxPort = 65535; const kInspectArgRegex = /--inspect(?:-brk|-port)?|--debug-port/; -const kInspectMsgRegex = /Debugger listening on ws:\/\/\[?(.+?)\]?:(\d+)\/|Debugger attached|Waiting for the debugger to disconnect\.\.\./; +const kInspectMsgRegex = /Debugger listening on ws:\/\/\[?(.+?)\]?:(\d+)\/|For help, see: https:\/\/nodejs\.org\/en\/docs\/inspector|Debugger attached|Waiting for the debugger to disconnect\.\.\./; const _isUsingInspector = new SafeWeakMap(); function isUsingInspector(execArgv = process.execArgv) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Landed in fec0fbc |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: #45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: #45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: #45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: #45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]>
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: nodejs/node#45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> (cherry picked from commit fec0fbc333c58e6ebbd2322f5120830fda880eb0)
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: nodejs/node#45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> (cherry picked from commit fec0fbc333c58e6ebbd2322f5120830fda880eb0)
The CLI test runner parses the TAP output from child processes now and displays it. This commit removes a previous workaround for displaying child process stdout and stderr when tests failures occurred. PR-URL: nodejs/node#45592 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> (cherry picked from commit fec0fbc333c58e6ebbd2322f5120830fda880eb0)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.