Bug 1493252 - Automatic profile viewing after mach talos-test doesn't work on my macOS machine. r=jmaher
authorFlorin Strugariu <bebe@mozilla.ro>
Mon, 08 Oct 2018 17:31:07 +0300
changeset 488473 afc8d7a964b47b410da037039017544a7cd1b7d6
parent 488472 d103737552074c130ec2599608f705bb837e5d60
child 488474 ef3fd2694a99ae9794f650ec6ca5282117d600b3
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersjmaher
bugs1493252
milestone64.0a1
Bug 1493252 - Automatic profile viewing after mach talos-test doesn't work on my macOS machine. r=jmaher
testing/mozharness/mozharness/mozilla/testing/talos.py
testing/talos/talos/run_tests.py
--- a/testing/mozharness/mozharness/mozilla/testing/talos.py
+++ b/testing/mozharness/mozharness/mozilla/testing/talos.py
@@ -598,16 +598,21 @@ class Talos(TestingMixin, MercurialScrip
                 _path = os.path.join(_virtualenv_path,
                                      'Lib',
                                      'site-packages')
             else:
                 _path = os.path.join(_virtualenv_path,
                                      'lib',
                                      os.path.basename(_python_interp),
                                      'site-packages')
+
+            # if  running gecko profiling  install the requirements
+            if self.gecko_profile:
+                self._install_view_gecko_profile_req()
+
             sys.path.append(_path)
             return
 
         # virtualenv doesn't already exist so create it
         # install mozbase first, so we use in-tree versions
         if not self.run_local:
             mozbase_requirements = os.path.join(
                 self.query_abs_dirs()['abs_test_install_dir'],
@@ -627,16 +632,19 @@ class Talos(TestingMixin, MercurialScrip
         )
         super(Talos, self).create_virtualenv()
         # talos in harness requires what else is
         # listed in talos requirements.txt file.
         self.install_module(
             requirements=[os.path.join(self.talos_path,
                                        'requirements.txt')]
         )
+        self._install_view_gecko_profile_req()
+
+    def _install_view_gecko_profile_req(self):
         # if running locally and gecko profiing is on, we will be using the
         # view-gecko-profile tool which has its own requirements too
         if self.gecko_profile and self.run_local:
             tools = os.path.join(self.config['repo_path'], 'testing', 'tools')
             view_gecko_profile_req = os.path.join(tools,
                                                   'view_gecko_profile',
                                                   'requirements.txt')
             self.info("installing requirements for the view-gecko-profile tool")
--- a/testing/talos/talos/run_tests.py
+++ b/testing/talos/talos/run_tests.py
@@ -345,16 +345,19 @@ def run_tests(config, browser_config):
 
     # we will stop running tests on a failed test, or we will return 0 for
     # green
     return 0
 
 
 def view_gecko_profile(ffox_bin):
     # automatically load the latest talos gecko-profile archive in perf-html.io
+    if sys.platform.startswith('win') and not ffox_bin.endswith(".exe"):
+        ffox_bin = ffox_bin + ".exe"
+
     if not os.path.exists(ffox_bin):
         LOG.info("unable to find Firefox bin, cannot launch view-gecko-profile")
         return
 
     profile_zip = os.environ.get('TALOS_LATEST_GECKO_PROFILE_ARCHIVE', None)
     if profile_zip is None or not os.path.exists(profile_zip):
         LOG.info("No local talos gecko profiles were found so not launching perf-html.io")
         return