Bug 1445716 - Support profile locations in geckoview-junit; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Wed, 25 Apr 2018 09:10:26 -0600
changeset 415641 fe6ddc27db724e631dee7921fdda2426f76ffb2f
parent 415640 ec40107c1c13b66359835df1925ec7caa6e9c622
child 415642 bf368c4e5c0a37074f5a74076ca5e4db4b1b0994
push id33901
push userapavel@mozilla.com
push dateThu, 26 Apr 2018 06:05:37 +0000
treeherdermozilla-central@b62ad926cf2a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1445716
milestone61.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 1445716 - Support profile locations in geckoview-junit; r=jmaher
testing/mochitest/runjunit.py
--- a/testing/mochitest/runjunit.py
+++ b/testing/mochitest/runjunit.py
@@ -13,16 +13,17 @@ import tempfile
 import traceback
 
 import mozcrash
 import mozinfo
 import mozlog
 import moznetwork
 from mozdevice import ADBAndroid
 from mozprofile import Profile, Preferences, DEFAULT_PORTS
+from mozprofile.permissions import ServerLocations
 from runtests import MochitestDesktop, update_mozinfo
 
 here = os.path.abspath(os.path.dirname(__file__))
 
 try:
     from mozbuild.base import (
         MozbuildObject,
         MachCommandConditions as conditions,
@@ -117,17 +118,18 @@ class JUnitTestRunner(MochitestDesktop):
             prefs[pref] = Preferences.cast(prefs[pref])
 
         proxy = {'remote': self.options.webServer,
                  'http': self.options.httpPort,
                  'https': self.options.sslPort,
                  'ws': self.options.sslPort
                  }
 
-        self.profile = Profile(preferences=prefs, proxy=proxy)
+        self.profile = Profile(locations=self.locations, preferences=prefs,
+                               proxy=proxy)
         self.options.profilePath = self.profile.profile
 
         if self.fillCertificateDB(self.options):
             self.log.error("Certificate integration failed")
 
         self.device.mkdir(self.remote_profile, parents=True)
         self.device.push(self.profile.profile, self.remote_profile)
         self.log.debug("profile %s -> %s" %
@@ -172,16 +174,24 @@ class JUnitTestRunner(MochitestDesktop):
         env["R_LOG_LEVEL"] = "6"
         env["R_LOG_DESTINATION"] = "stderr"
         for (env_count, (env_key, env_val)) in enumerate(env.iteritems()):
             cmd = cmd + " -e env%d %s=%s" % (env_count, env_key, env_val)
         # runner
         cmd = cmd + " %s/%s" % (self.options.app, self.options.runner)
         return cmd
 
+    @property
+    def locations(self):
+        if self._locations is not None:
+            return self._locations
+        locations_file = os.path.join(here, 'server-locations.txt')
+        self._locations = ServerLocations(locations_file)
+        return self._locations
+
     def run_tests(self, test_filters=None):
         """
            Run the tests.
         """
         if not self.device.is_app_installed(self.options.app):
             raise Exception("%s is not installed" %
                             self.options.app)
         if self.device.process_exist(self.options.app):