diff --git a/package-lock.json b/package-lock.json index 328654d..98084b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "testarmada-magellan", - "version": "11.0.12", + "version": "11.0.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c034bde..18b9d92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "testarmada-magellan", - "version": "11.0.13", + "version": "11.0.14", "description": "Massively parallel automated testing", "main": "src/main", "directories": { diff --git a/src/util/childProcess.js b/src/util/childProcess.js index 75d3565..e0731cb 100644 --- a/src/util/childProcess.js +++ b/src/util/childProcess.js @@ -33,7 +33,8 @@ const STDOUT_WHITE_LIST = [ "\x1B[1;33mERROR\x1B[0m", "\x1B[1;32m\x1B[40mWARN\x1B[0m", "Test Suite", - "✖" + "✖", + "✔" ]; // we slice the VERBOSE nighwatch stdout stream on the purple INFO text that has black background @@ -58,6 +59,24 @@ module.exports = class ChildProcess { transform(data, encoding, callback) { let text = data.toString().trim(); if (text.length > 0 && self.isTextWhiteListed(text)) { + if (!process.env.DEBUG && text.includes("✔")) { + // for successful chunks we really only want to keep specific lines + const lines = text.split("\n"); + const buff = []; + const startsWithTerms = ["Running:", " ✔", "OK."]; + const maxLineLength = 512; + const processLine = (line) => { + for (const term of startsWithTerms) { + // line could have an ERROR or WARN tag that is whitelisted we want to keep + if (self.isTextWhiteListed(line) || line.startsWith(term)) { + // limit the length of each line, goal here is to "limit" verbosity + buff.push(line.substring(0, maxLineLength)); + } + } + }; + lines.forEach(line => processLine(line)); + text = buff.join("\n"); + } text = text .split("\n") .filter((line) => !_.isEmpty(line.trim())) @@ -74,6 +93,7 @@ module.exports = class ChildProcess { this.emitter = new EventEmitter(); this.emitter.stdout = stdoutFilter; this.emitter.stderr = handler.stderr; + this.emitter.infoSlicer = infoSlicer; // pipe the stdout stream into the slicer and then into the filter this.handler.stdout.pipe(infoSlicer).pipe(stdoutFilter);