Skip to content

Commit 66a9417

Browse files
authored
Add Tasks to failed test match. (#4959)
1 parent 66afe0d commit 66a9417

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/build/citool

+6-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def parseArgs():
7878

7979
subparser = subparsers.add_parser('monitor', help='report passing or failing tests (only failing tests by default)')
8080
subparser.add_argument('-a', '--all', help='show all tests suites, passing and failing', action='store_true')
81+
subparser.add_argument('-r', '--relax', help='relax regex match to include failed ansible tasks', action='store_true')
8182
subparser.add_argument('-p', '--poll', help='repeat monitor every 10 seconds', action='store_true')
8283

8384
subparser = subparsers.add_parser('cat', help='concatenate logs from build (limited to Jenkins)')
@@ -241,7 +242,11 @@ def grepForFailingTests(args, body):
241242
print('No tests detected.')
242243
# no tests: either build failure or task not yet reached, skip further check
243244
else:
244-
cmd = 'grep -E "^\w+\.*.*[>|>] \w*.* FAILED%s"' % ("|PASSED" if args.all else "")
245+
if args.relax:
246+
# this will match failed ansible tasks as well
247+
cmd = 'grep -E "^> Task *.* FAILED|^\w+\.*.*[>|>] \w*.* FAILED%s"' % ("|PASSED" if args.all else "")
248+
else:
249+
cmd = 'grep -E "^> Task *.* FAILED|^[\w.]+\s*[>|>] \w*.* FAILED%s"' % ("|PASSED" if args.all else "")
245250
(time, output, error) = shell(cmd, body, args.verbose)
246251
if output == '':
247252
print('All tests passing.')

0 commit comments

Comments
 (0)