Bug 1343361 - Auomatically replace `-u all` with a set of suites that do not include compiled tests when requesting an artifact build via |./mach try|. r=maja_zf
authorChris Manchester <cmanchester@mozilla.com>
Tue, 28 Feb 2017 14:27:57 -0800
changeset 394163 e35efb0da85ffbf8ad02f9bd1765e3557db302ed
parent 394162 3cb6398d924bbdf2d5596f2c49cabee743a3da0d
child 394164 8208390294f98cf877b1a088f7811d0d6d52fda0
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1343361
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1343361 - Auomatically replace `-u all` with a set of suites that do not include compiled tests when requesting an artifact build via |./mach try|. r=maja_zf MozReview-Commit-ID: BYgzbYrbw7E
testing/tools/autotry/autotry.py
--- a/testing/tools/autotry/autotry.py
+++ b/testing/tools/autotry/autotry.py
@@ -403,16 +403,29 @@ class AutoTry(object):
             rejected = []
             for suite in suites.keys():
                 if any([suite.startswith(c) for c in self.compiled_suites]):
                     rejected.append(suite)
             if rejected:
                 raise ValueError("You can't run {} with "
                                  "--artifact option.".format(', '.join(rejected)))
 
+        if extras.get('artifact') and 'all' in suites.keys():
+            non_compiled_suites = set(self.common_suites) - set(self.compiled_suites)
+            message = ('You asked for |-u all| with |--artifact| but compiled-code tests ({tests})'
+                       ' can\'t run against an artifact build. Running (-u {non_compiled_suites}) '
+                       'instead.')
+            string_format = {
+                'tests': ','.join(self.compiled_suites),
+                'non_compiled_suites': ','.join(non_compiled_suites),
+            }
+            print(message.format(**string_format))
+            del suites['all']
+            suites.update({suite_name: None for suite_name in non_compiled_suites})
+
         parts.append("-u")
         parts.append(",".join("%s%s" % (k, "[%s]" % ",".join(v) if v else "")
                               for k,v in sorted(suites.items())) if suites else "none")
 
         parts.append("-t")
         parts.append(",".join("%s%s" % (k, "[%s]" % ",".join(v) if v else "")
                               for k,v in sorted(talos.items())) if talos else "none")
 
@@ -433,29 +446,16 @@ class AutoTry(object):
             if action == 'append':
                 for e in value:
                     parts.append(arg)
                     parts.append(e)
             if action in ('store_true', 'store_false'):
                 parts.append(arg)
 
         try_syntax = " ".join(parts)
-        if extras.get('artifact') and 'all' in suites.keys():
-            message = ('You asked for |-u all| with |--artifact| but compiled-code tests ({tests})'
-                       ' can\'t run against an artifact build. Try listing the suites you want'
-                       ' instead. For example, this syntax covers most suites:\n{try_syntax}')
-            string_format = {
-                'tests': ','.join(self.compiled_suites),
-                'try_syntax': try_syntax.replace(
-                    '-u all',
-                    '-u ' + ','.join(sorted(set(self.common_suites) - set(self.compiled_suites)))
-                )
-            }
-            raise ValueError(message.format(**string_format))
-
         return try_syntax
 
     def _run_git(self, *args):
         args = ['git'] + list(args)
         ret = subprocess.call(args)
         if ret:
             print('ERROR git command %s returned %s' %
                   (args, ret))