Bug 1554493 - [ci] Improve some formatting in try_option_syntax.py, r?jmaher draft
authorpulselistener
Mon, 27 May 2019 13:54:52 +0000
changeset 2026409 2297dcca21d2ecf42d1ccc0804c529d06683c96e
parent 2025407 893e1d6cad95e3e7ffdb3d0daf4a26fcea4a68bd
child 2026410 afe088cc644e5261ead9da92c0fa6f0a89dd6359
push id368009
push userreviewbot
push dateMon, 27 May 2019 13:55:45 +0000
treeherdertry@5711f8a770bc [default view] [failures only]
reviewersjmaher
bugs1554493
milestone69.0a1
Bug 1554493 - [ci] Improve some formatting in try_option_syntax.py, r?jmaher Differential Diff: PHID-DIFF-w4va7n67cqndnkik3r6n
taskcluster/taskgraph/try_option_syntax.py
--- a/taskcluster/taskgraph/try_option_syntax.py
+++ b/taskcluster/taskgraph/try_option_syntax.py
@@ -580,32 +580,35 @@ class TryOptionSyntax(object):
         # Don't schedule android-hw tests when try option syntax is used
         if 'android-hw' in task.label:
             return False
 
         def match_test(try_spec, attr_name):
             run_by_default = True
             if attr('build_type') not in self.build_types:
                 return False
-            if self.platforms is not None:
-                if attr('build_platform') not in self.platforms:
-                    return False
-            else:
-                if not check_run_on_projects():
-                    run_by_default = False
+
+            if self.platforms is not None and attr('build_platform') not in self.platforms:
+                return False
+            elif not check_run_on_projects():
+                run_by_default = False
+
             if try_spec is None:
                 return run_by_default
+
             # TODO: optimize this search a bit
             for test in try_spec:
                 if attr(attr_name) == test['test']:
                     break
             else:
                 return False
+
             if 'only_chunks' in test and attr('test_chunk') not in test['only_chunks']:
                 return False
+
             tier = task.task['extra']['treeherder']['tier']
             if 'platforms' in test:
                 if 'all' in test['platforms']:
                     return True
                 platform = attr('test_platform', '').split('/')[0]
                 # Platforms can be forced by syntax like "-u xpcshell[Windows 8]"
                 return platform in test['platforms']
             elif tier != 1: