Bug 1488544 - Do not check for android device when running desktop raptor-test; r=rwood
authorGeoff Brown <gbrown@mozilla.com>
Tue, 04 Sep 2018 15:16:18 -0600
changeset 482960 b2149dbabea1f15ee4d34ab1f3994e2dcbcee30f
parent 482959 e1e44835bf32093e0b5f0504b850f737099da16c
child 482961 186b3f9b43c1a4f1f898150d0b6344af184aab6b
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersrwood
bugs1488544
milestone63.0a1
Bug 1488544 - Do not check for android device when running desktop raptor-test; r=rwood
testing/raptor/mach_commands.py
--- a/testing/raptor/mach_commands.py
+++ b/testing/raptor/mach_commands.py
@@ -14,16 +14,17 @@ import json
 import shutil
 import socket
 import subprocess
 
 import mozfile
 from mach.decorators import CommandProvider, Command
 from mozboot.util import get_state_dir
 from mozbuild.base import MozbuildObject, MachCommandBase
+from mozbuild.base import MachCommandConditions as conditions
 
 HERE = os.path.dirname(os.path.realpath(__file__))
 BENCHMARK_REPOSITORY = 'https://github.com/mozilla/perf-automation'
 BENCHMARK_REVISION = '4befd28725c687b91ce749420eab29352ecbcab4'
 
 
 class RaptorRunner(MozbuildObject):
     def run_test(self, raptor_args, app=None):
@@ -156,21 +157,22 @@ def create_parser():
 
 @CommandProvider
 class MachRaptor(MachCommandBase):
     @Command('raptor-test', category='testing',
              description='Run raptor performance tests.',
              parser=create_parser)
     def run_raptor_test(self, **kwargs):
 
-        from mozrunner.devices.android_device import verify_android_device
+        build_obj = MozbuildObject.from_environment(cwd=HERE)
 
-        build_obj = MozbuildObject.from_environment(cwd=HERE)
-        if not verify_android_device(build_obj, install=True, app=kwargs['binary']):
-            return 1
+        if conditions.is_android(build_obj) or kwargs['app'] == 'geckoview':
+            from mozrunner.devices.android_device import verify_android_device
+            if not verify_android_device(build_obj, install=True, app=kwargs['binary']):
+                return 1
 
         debug_command = '--debug-command'
         if debug_command in sys.argv:
             sys.argv.remove(debug_command)
 
         raptor = self._spawn(RaptorRunner)
 
         try: