Bug 1499061 - Only do wpt mozdevice imports when running fennec, r=gbrown
authorJames Graham <james@hoppipolla.co.uk>
Mon, 15 Oct 2018 14:44:08 +0000
changeset 499748 9b9dcee0058edfd5020f141285e021cc912c27d4
parent 499747 04459ddd517a051f4dd0c69c6177de1a61921bc9
child 499749 dcd095eb89108d1171c25b9d32ca01a6d317087f
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1499061
milestone64.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 1499061 - Only do wpt mozdevice imports when running fennec, r=gbrown Otherwise some users see problems due to missing psutil. Differential Revision: https://phabricator.services.mozilla.com/D8715
testing/web-platform/mach_commands.py
--- a/testing/web-platform/mach_commands.py
+++ b/testing/web-platform/mach_commands.py
@@ -22,24 +22,25 @@ from mach.decorators import (
 
 from mach_commands_base import WebPlatformTestsRunner, create_parser_wpt
 
 
 class WebPlatformTestsRunnerSetup(MozbuildObject):
     default_log_type = "mach"
 
     def kwargs_common(self, kwargs):
-        from mozrunner.devices.android_device import verify_android_device, grant_runtime_permissions
         build_path = os.path.join(self.topobjdir, 'build')
         here = os.path.split(__file__)[0]
         tests_src_path = os.path.join(here, "tests")
         if build_path not in sys.path:
             sys.path.append(build_path)
 
         if kwargs["product"] == "fennec":
+            # Note that this import may fail in non-fennec trees
+            from mozrunner.devices.android_device import verify_android_device, grant_runtime_permissions
             verify_android_device(self, install=True, verbose=False, xre=True)
 
             # package_name may be non-fennec in the future
             package_name = kwargs["package_name"]
             if not package_name:
                 package_name = self.substs["ANDROID_PACKAGE_NAME"]
 
             grant_runtime_permissions(self, package_name, kwargs["device_serial"])