Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

Commit 597c9e6

Browse files
authored
Merge pull request #292 from TestArmada/fix-bug-wth-steps-not-showing
fix bug with successful steps not showing in log
2 parents c53c725 + ffc9b82 commit 597c9e6

3 files changed

Lines changed: 23 additions & 3 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "testarmada-magellan",
3-
"version": "11.0.13",
3+
"version": "11.0.14",
44
"description": "Massively parallel automated testing",
55
"main": "src/main",
66
"directories": {

src/util/childProcess.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ const STDOUT_WHITE_LIST = [
3333
"\x1B[1;33mERROR\x1B[0m",
3434
"\x1B[1;32m\x1B[40mWARN\x1B[0m",
3535
"Test Suite",
36-
"✖"
36+
"✖",
37+
"✔"
3738
];
3839

3940
// we slice the VERBOSE nighwatch stdout stream on the purple INFO text that has black background
@@ -58,6 +59,24 @@ module.exports = class ChildProcess {
5859
transform(data, encoding, callback) {
5960
let text = data.toString().trim();
6061
if (text.length > 0 && self.isTextWhiteListed(text)) {
62+
if (!process.env.DEBUG && text.includes("✔")) {
63+
// for successful chunks we really only want to keep specific lines
64+
const lines = text.split("\n");
65+
const buff = [];
66+
const startsWithTerms = ["Running:", " ✔", "OK."];
67+
const maxLineLength = 512;
68+
const processLine = (line) => {
69+
for (const term of startsWithTerms) {
70+
// line could have an ERROR or WARN tag that is whitelisted we want to keep
71+
if (self.isTextWhiteListed(line) || line.startsWith(term)) {
72+
// limit the length of each line, goal here is to "limit" verbosity
73+
buff.push(line.substring(0, maxLineLength));
74+
}
75+
}
76+
};
77+
lines.forEach(line => processLine(line));
78+
text = buff.join("\n");
79+
}
6180
text = text
6281
.split("\n")
6382
.filter((line) => !_.isEmpty(line.trim()))
@@ -74,6 +93,7 @@ module.exports = class ChildProcess {
7493
this.emitter = new EventEmitter();
7594
this.emitter.stdout = stdoutFilter;
7695
this.emitter.stderr = handler.stderr;
96+
this.emitter.infoSlicer = infoSlicer;
7797

7898
// pipe the stdout stream into the slicer and then into the filter
7999
this.handler.stdout.pipe(infoSlicer).pipe(stdoutFilter);

0 commit comments

Comments
 (0)