Currently when running talos tests with gecko profiling on, the resulting profiles are zipped up (and uploaded as an artifact if running in production). draft
authorRob Wood <rwood@mozilla.com>
Wed, 10 Jan 2018 16:47:44 -0500
changeset 718831 9573cda49cdea5a4e5f79ca20ffdc35c55d6e090
parent 718696 68b7531613497d4278991e7e32fca8378f657534
child 745601 90392a58536c09218f2c4be4a1fd9598ecdf92c8
push id95050
push userrwood@mozilla.com
push dateWed, 10 Jan 2018 21:49:03 +0000
milestone59.0a1
Currently when running talos tests with gecko profiling on, the resulting profiles are zipped up (and uploaded as an artifact if running in production). This patch creates a 'latest-talos-profiles' folder (along side talos.json) when running locally, and stores the profiles there (as well as in the zip file). This will allow us to easily view the gecko profiles from the latest talos test run, without having to find and unzip the profiles zip. MozReview-Commit-ID: CkDy3FZILvU
testing/talos/talos/gecko_profile.py
--- a/testing/talos/talos/gecko_profile.py
+++ b/testing/talos/talos/gecko_profile.py
@@ -61,16 +61,22 @@ class GeckoProfile(object):
 
         self.profiling_info = {
             "gecko_profile_interval": gecko_profile_interval,
             "gecko_profile_entries": gecko_profile_entries,
             "gecko_profile_dir": gecko_profile_dir,
             "gecko_profile_threads": gecko_profile_threads
         }
 
+        # profiles will be zipped up, but also stored locally on disk in a
+        # talos latest profiles folder, so they can easily be viewed later
+        self.latest_profiles_dir = os.path.join(os.getcwd(), "latest-talos-profiles")
+        if os.path.exists(self.latest_profiles_dir):
+            mozfile.remove(self.latest_profiles_dir)
+
     def option(self, name):
         return self.profiling_info["gecko_profile_" + name]
 
     def update_env(self, env):
         """
         update the given env to update some env vars if required.
         """
         if not self.test_config.get('gecko_profile_startup'):
@@ -195,15 +201,23 @@ class GeckoProfile(object):
                 except Exception:
                     LOG.exception(
                         "Failed to copy profile {0} as {1} to"
                         " archive {2}".format(profile_path,
                                               path_in_zip,
                                               self.profile_arcname)
                     )
 
+        # we also want to keep a readable copy of our profiles so
+        # that we can view them in the gecko profiler without unzipping
+        # (only when running locally, in production the zip is uploaded)
+        if self.browser_config['develop']:
+            mozfile.extract(self.profile_arcname, self.latest_profiles_dir)
+            LOG.info("Profiles are also available in {0}"
+                     .format(self.latest_profiles_dir))
+
     def clean(self):
         """
         Clean up temp folders created with the instance creation.
         """
         mozfile.remove(self.option('dir'))
         for symbol_path in self.symbol_paths.values():
             mozfile.remove(symbol_path)