From b0b3f8a09331ddfe787c88603198992192e25ebc Mon Sep 17 00:00:00 2001 From: John Bouchard Date: Thu, 10 Sep 2020 16:25:54 -0700 Subject: [PATCH 1/4] the-fix-is-in --- package-lock.json | 2 +- package.json | 2 +- src/util/childProcess.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) 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..c0282de 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 From a6ed0b3241929d651a213bedb7a2495c4042d0f3 Mon Sep 17 00:00:00 2001 From: John Bouchard Date: Thu, 10 Sep 2020 16:55:31 -0700 Subject: [PATCH 2/4] add extra filter on success (check) chunks --- src/util/childProcess.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/util/childProcess.js b/src/util/childProcess.js index c0282de..92668be 100644 --- a/src/util/childProcess.js +++ b/src/util/childProcess.js @@ -59,6 +59,22 @@ module.exports = class ChildProcess { transform(data, encoding, callback) { let text = data.toString().trim(); if (text.length > 0 && self.isTextWhiteListed(text)) { + if (text.includes("✔")) { + // for successful chunks we really only want to keep specific lines + const lines = text.split("\n"); + const buff = []; + const startWithTerms = ["Running:", " ✔", "OK."]; + const processLine = (line) => { + for (const term of startWithTerms) { + // line could have an ERROR or WARN tag that is whitelisted we want to keep + if (self.isTextWhiteListed(line) || line.startsWith(term)) { + buff.push(line); + } + } + }; + lines.forEach(line => processLine(line)); + text = buff.join("\n"); + } text = text .split("\n") .filter((line) => !_.isEmpty(line.trim())) @@ -75,6 +91,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); From 6039dbc65716d7bd7532efcb6397c5a2c4704ddd Mon Sep 17 00:00:00 2001 From: John Bouchard Date: Thu, 10 Sep 2020 17:09:32 -0700 Subject: [PATCH 3/4] add-line-limiter --- src/util/childProcess.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/util/childProcess.js b/src/util/childProcess.js index 92668be..862ab36 100644 --- a/src/util/childProcess.js +++ b/src/util/childProcess.js @@ -59,16 +59,17 @@ module.exports = class ChildProcess { transform(data, encoding, callback) { let text = data.toString().trim(); if (text.length > 0 && self.isTextWhiteListed(text)) { - if (text.includes("✔")) { + 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 startWithTerms = ["Running:", " ✔", "OK."]; + const startsWithTerms = ["Running:", " ✔", "OK."]; const processLine = (line) => { - for (const term of startWithTerms) { + 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)) { - buff.push(line); + // limit the length of each line, goal here is to "limit" verbosity + buff.push(line.substring(0, 512)); } } }; From ffc9b827973842a2be2567ea9b6b3bff1891a837 Mon Sep 17 00:00:00 2001 From: John Bouchard Date: Thu, 10 Sep 2020 17:12:50 -0700 Subject: [PATCH 4/4] lint-fix --- src/util/childProcess.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/childProcess.js b/src/util/childProcess.js index 862ab36..e0731cb 100644 --- a/src/util/childProcess.js +++ b/src/util/childProcess.js @@ -64,12 +64,13 @@ module.exports = class ChildProcess { 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, 512)); + buff.push(line.substring(0, maxLineLength)); } } };