Skip to content

Commit

Permalink
Add Tasks to failed test match. (#4959)
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbah committed Sep 3, 2020
1 parent 66afe0d commit 66a9417
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/build/citool
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def parseArgs():

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

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

0 comments on commit 66a9417

Please sign in to comment.