Skip to content

Commit f8e2a17

Browse files
joyeecheungpriyank-p
authored andcommitted
ci: handle empty matches correctly
1 parent 0b9a09c commit f8e2a17

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/ci/ci_failure_parser.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ const FAILURE_FILTERS = [{
105105
return null;
106106
}
107107
const nonFlaky = matches.filter((m) => !m.includes('# TODO :'));
108+
if (!nonFlaky.length) {
109+
return null;
110+
}
108111
return unique(nonFlaky).map(
109112
match => new JSTestFailure(ctx, match)
110113
);
@@ -176,7 +179,7 @@ const FAILURE_FILTERS = [{
176179
const pattern = /fatal: .+/g;
177180
const matches = text.match(pattern);
178181
if (!matches) {
179-
return [];
182+
return null;
180183
}
181184
const reason = unique(matches).join('\n');
182185
return [new BuildFailure(ctx, reason)];
@@ -187,7 +190,7 @@ const FAILURE_FILTERS = [{
187190
pattern: /FATAL: .+/g,
188191
context: { index: -1, contextBefore: 0, contextAfter: 5 }
189192
}, {
190-
match: /error: .+/g,
193+
pattern: /error: .+/g,
191194
context: { index: 0, contextBefore: 0, contextAfter: 5 }
192195
}, {
193196
pattern: /make.*: write error/mg,

0 commit comments

Comments
 (0)