Bug 1262158 - Fix default tests being overwritten in mach firefox-ui-_; r=sydpolk
authorMaja Frydrychowicz <mjzffr@gmail.com>
Thu, 14 Apr 2016 18:17:40 -0400
changeset 317446 865e124224cd54ec70adbefbcb8a750f5e1d985c
parent 317445 e9500cac731dcc7456eee99ea16c9163a9c40b34
child 317447 f5f9a967030d8104686224579294d5aeafff8b5a
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssydpolk
bugs1262158
milestone48.0a1
Bug 1262158 - Fix default tests being overwritten in mach firefox-ui-_; r=sydpolk MozReview-Commit-ID: JP59lLBRMc1
testing/firefox-ui/mach_commands.py
--- a/testing/firefox-ui/mach_commands.py
+++ b/testing/firefox-ui/mach_commands.py
@@ -55,26 +55,25 @@ def run_firefox_ui_test(testtype=None, t
 
     fxui_dir = os.path.join(topsrcdir, 'testing', 'firefox-ui')
 
     # Set the resources path which is used to serve test data via wptserve
     if not kwargs['server_root']:
         kwargs['server_root'] = os.path.join(fxui_dir, 'resources')
 
     # If no tests have been selected, set default ones
-    if kwargs.get('tests'):
-        tests = kwargs.get('tests')
-    else:
-        tests = [os.path.join(fxui_dir, 'tests', test)
+    if not kwargs.get('tests'):
+        kwargs['tests'] = [os.path.join(fxui_dir, 'tests', test)
                            for test in test_types[testtype]['default_tests']]
 
     kwargs['logger'] = commandline.setup_logging('Firefox UI - {} Tests'.format(testtype),
                                                  {"mach": sys.stdout})
 
-    args = parser.parse_args(args=tests)
+    # pass tests to parse_args to avoid rereading sys.argv
+    args = parser.parse_args(args=kwargs['tests'])
 
     for k, v in kwargs.iteritems():
         setattr(args, k, v)
 
     parser.verify_usage(args)
 
     failed = test_types[testtype]['cli_module'].cli(args=vars(args))