test_runner: remove stdout and stderr from error

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: https://github.com/nodejs/node/pull/45592
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
This commit is contained in:
Colin Ihrig authored and GitHub committed 2022-11-25 02:48:21 +00:00
1 parent a01dbf179e
commit fec0fbc333
1 file changed
+1 -8
+1 -8
View File
@@ -234,7 +234,6 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
runningProcesses.set(path, child);
let err;
let stderr = '';
filesWatcher?.watchChildProcessModules(child, path);
@@ -242,10 +241,6 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
err = error;
});
child.stderr.on('data', (data) => {
stderr += data;
});
if (isUsingInspector()) {
const rl = createInterface({ input: child.stderr });
rl.on('line', (line) => {
@@ -266,7 +261,7 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
subtest.addToReport(ast);
});
const { 0: { 0: code, 1: signal }, 1: stdout } = await SafePromiseAll([
const { 0: { 0: code, 1: signal } } = await SafePromiseAll([
once(child, 'exit', { signal: t.signal }),
child.stdout.toArray({ signal: t.signal }),
]);
@@ -279,8 +274,6 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
__proto__: null,
exitCode: code,
signal: signal,
stdout: ArrayPrototypeJoin(stdout, ''),
stderr,
// The stack will not be useful since the failures came from tests
// in a child process.
stack: undefined,