Bug 1282488 - Warn about unused `--binary` option in `mach marionette-test`; r?maja_zf draft
authorAnjana Vakil <anjanavakil@gmail.com>
Mon, 27 Jun 2016 20:21:31 +0200
changeset 381544 c5a52c3a28b01aa002dad3412235116eb8a21836
parent 381476 0e3f8401b804702c894eb5fdf7eae3cbdf618668
child 381836 251c31b817032deb467e829092fe035cc1ecbdd1
push id21505
push useranjanavakil@gmail.com
push dateMon, 27 Jun 2016 18:22:28 +0000
reviewersmaja_zf
bugs1282488
milestone50.0a1
Bug 1282488 - Warn about unused `--binary` option in `mach marionette-test`; r?maja_zf If a user passes the `--binary` option to the `marionette-test` mach command, instead of silently ignoring the given path in favor of `self.get_binary_path`, print a warning message and the path to the binary being used. MozReview-Commit-ID: AVbpExDlaql
testing/marionette/mach_commands.py
--- a/testing/marionette/mach_commands.py
+++ b/testing/marionette/mach_commands.py
@@ -142,17 +142,20 @@ class MachCommands(MachCommandBase):
     )
     def run_marionette_test(self, tests, **kwargs):
         if 'test_objects' in kwargs:
             tests = []
             for obj in kwargs['test_objects']:
                 tests.append(obj['file_relpath'])
             del kwargs['test_objects']
 
-        kwargs['binary'] = self.get_binary_path('app')
+        bin_path = self.get_binary_path('app')
+        if 'binary' in kwargs:
+            print "Warning: ignoring '--binary' option, using binary at " + bin_path
+        kwargs['binary'] = bin_path
         return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
 
     @Command('session-test', category='testing',
         description='Run a Session test (Check Telemetry using marionette).',
         conditions=[conditions.is_firefox],
         parser=setup_session_argument_parser,
     )
     def run_session_test(self, tests, **kwargs):