--- a/taskcluster/taskgraph/try_option_syntax.py
+++ b/taskcluster/taskgraph/try_option_syntax.py
@@ -166,33 +166,34 @@ RIDEALONG_BUILDS = {
'sm-tsan',
'sm-asan',
'sm-msan',
],
}
TEST_CHUNK_SUFFIX = re.compile('(.*)-([0-9]+)$')
+
class TryOptionSyntax(object):
def __init__(self, message, full_task_graph):
"""
Parse a "try syntax" formatted commit message. This is the old "-b do -p
win32 -u all" format. Aliases are applied to map short names to full
names.
The resulting object has attributes:
- build_types: a list containing zero or more of 'opt' and 'debug'
- platforms: a list of selected platform names, or None for all
- unittests: a list of tests, of the form given below, or None for all
- jobs: a list of requested job names, or None for all
- trigger_tests: the number of times tests should be triggered (--rebuild)
- interactive: true if --interactive
- - notifications: one of 'none', 'all', 'failure'
+ - notifications: either None if no notifications or one of 'all' or 'failure'
Note that -t is currently completely ignored.
The unittests and talos lists contain dictionaries of the form:
{
'test': '<suite name>',
'platforms': [..platform names..], # to limit to only certain platforms
@@ -201,17 +202,17 @@ class TryOptionSyntax(object):
"""
self.jobs = []
self.build_types = []
self.platforms = []
self.unittests = []
self.talos = []
self.trigger_tests = 0
self.interactive = False
- self.notifications = 'none'
+ self.notifications = None
# shlex used to ensure we split correctly when giving values to argparse.
parts = shlex.split(self.escape_whitespace_in_brackets(message))
try_idx = None
for idx, part in enumerate(parts):
if part == TRY_DELIMITER:
try_idx = idx
break
@@ -224,32 +225,34 @@ class TryOptionSyntax(object):
parser.add_argument('-b', '--build', dest='build_types')
parser.add_argument('-p', '--platform', nargs='?',
dest='platforms', const='all', default='all')
parser.add_argument('-u', '--unittests', nargs='?',
dest='unittests', const='all', default='all')
parser.add_argument('-t', '--talos', nargs='?', dest='talos', const='all', default='all')
parser.add_argument('-i', '--interactive',
dest='interactive', action='store_true', default=False)
- parser.add_argument('-e', '--all-emails', dest='notifications', action='store_const', const='all')
- parser.add_argument('-f', '--failure-emails', dest='notifications', action='store_const', const='failure')
+ parser.add_argument('-e', '--all-emails',
+ dest='notifications', action='store_const', const='all')
+ parser.add_argument('-f', '--failure-emails',
+ dest='notifications', action='store_const', const='failure')
parser.add_argument('-j', '--job', dest='jobs', action='append')
# In order to run test jobs multiple times
parser.add_argument('--rebuild', dest='trigger_tests', type=int, default=1)
args, _ = parser.parse_known_args(parts[try_idx:])
self.jobs = self.parse_jobs(args.jobs)
self.build_types = self.parse_build_types(args.build_types)
self.platforms = self.parse_platforms(args.platforms)
self.unittests = self.parse_test_option(
"unittest_try_name", args.unittests, full_task_graph)
self.talos = self.parse_test_option("talos_try_name", args.talos, full_task_graph)
self.trigger_tests = args.trigger_tests
self.interactive = args.interactive
- self.notifications = args.notifications or self.notifications
+ self.notifications = args.notifications
def parse_jobs(self, jobs_arg):
if not jobs_arg or jobs_arg == ['all']:
return None
expanded = []
for job in jobs_arg:
expanded.extend(j.strip() for j in job.split(','))
return expanded