Bug 1259684 - Allow more options in 'mach try'; r=chmanchester
authorGeoff Brown <gbrown@mozilla.com>
Thu, 31 Mar 2016 20:35:53 -0600
changeset 291179 562a23b80b8c4cf16077f44ff657aa9e2494b74b
parent 291178 2605e7e25764fd4591ff1bbe788b5e3e8e498e65
child 291180 3dbb54c784bf9bbaaa6769604c1de746763006fe
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1259684
milestone48.0a1
Bug 1259684 - Allow more options in 'mach try'; r=chmanchester
testing/tools/autotry/autotry.py
--- a/testing/tools/autotry/autotry.py
+++ b/testing/tools/autotry/autotry.py
@@ -13,39 +13,39 @@ import which
 from collections import defaultdict
 
 import ConfigParser
 
 
 def arg_parser():
     parser = argparse.ArgumentParser()
     parser.add_argument('paths', nargs='*', help='Paths to search for tests to run on try.')
-    parser.add_argument('-b', dest='builds', default='do',
+    parser.add_argument('-b', '--build', dest='builds', default='do',
                         help='Build types to run (d for debug, o for optimized).')
-    parser.add_argument('-p', dest='platforms', action="append",
+    parser.add_argument('-p', '--platform', dest='platforms', action='append',
                         help='Platforms to run (required if not found in the environment as AUTOTRY_PLATFORM_HINT).')
-    parser.add_argument('-u', dest='tests', action="append",
+    parser.add_argument('-u', '--unittests', dest='tests', action='append',
                         help='Test suites to run in their entirety.')
-    parser.add_argument('-t', dest="talos", action="append",
+    parser.add_argument('-t', '--talos', dest='talos', action='append',
                         help='Talos suites to run.')
     parser.add_argument('--tag', dest='tags', action='append',
                         help='Restrict tests to the given tag (may be specified multiple times).')
-    parser.add_argument('--and', action='store_true', dest="intersection",
+    parser.add_argument('--and', action='store_true', dest='intersection',
                         help='When -u and paths are supplied run only the intersection of the tests specified by the two arguments.')
     parser.add_argument('--no-push', dest='push', action='store_false',
                         help='Do not push to try as a result of running this command (if '
                         'specified this command will only print calculated try '
                         'syntax and selection info).')
-    parser.add_argument('--save', dest="save", action='store',
-                        help="Save the command line arguments for future use with --preset.")
-    parser.add_argument('--preset', dest="load", action='store',
-                        help="Load a saved set of arguments. Additional arguments will override saved ones.")
+    parser.add_argument('--save', dest='save', action='store',
+                        help='Save the command line arguments for future use with --preset.')
+    parser.add_argument('--preset', dest='load', action='store',
+                        help='Load a saved set of arguments. Additional arguments will override saved ones.')
     parser.add_argument('--list', action='store_true',
-                        help="List all saved try strings")
-    parser.add_argument('-v', "--verbose", dest='verbose', action='store_true', default=False,
+                        help='List all saved try strings')
+    parser.add_argument('-v', '--verbose', dest='verbose', action='store_true', default=False,
                         help='Print detailed information about the resulting test selection '
                         'and commands performed.')
     for arg, opts in AutoTry.pass_through_arguments.items():
         parser.add_argument(arg, **opts)
     return parser
 
 class TryArgumentTokenizer(object):
     symbols = [("seperator", ","),
@@ -200,16 +200,36 @@ class AutoTry(object):
             'dest': 'no_retry',
             'help': 'Do not retrigger failed tests',
         },
         '--setenv': {
             'action': 'append',
             'dest': 'setenv',
             'help': 'Set the corresponding variable in the test environment for'
                     'applicable harnesses.',
+        },
+        '-f': {
+            'action': 'store_true',
+            'dest': 'failure_emails',
+            'help': 'Request failure emails only',
+        },
+        '--failure-emails': {
+            'action': 'store_true',
+            'dest': 'failure_emails',
+            'help': 'Request failure emails only',
+        },
+        '-e': {
+            'action': 'store_true',
+            'dest': 'all_emails',
+            'help': 'Request all emails',
+        },
+        '--all-emails': {
+            'action': 'store_true',
+            'dest': 'all_emails',
+            'help': 'Request all emails',
         }
     }
 
     def __init__(self, topsrcdir, resolver_func, mach_context):
         self.topsrcdir = topsrcdir
         self._resolver_func = resolver_func
         self._resolver = None
         self.mach_context = mach_context