Bug 1317976 - enable generate-build-stats on tc win builds r=gps,ted
authorRob Thijssen <rthijssen@mozilla.com>
Fri, 02 Dec 2016 16:40:36 +0000
changeset 325143 6d2d2fdac6c7668cc7d33a79d5b05b420f721824
parent 325142 23eb207c40d8949ca2f6db414c1376955fff4d80
child 325144 36a7105524b6ed162203431ecced7d0bbf6286f5
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersgps, ted
bugs1317976
milestone53.0a1
Bug 1317976 - enable generate-build-stats on tc win builds r=gps,ted MozReview-Commit-ID: 7iDpPfRFibW
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_debug.py
@@ -11,16 +11,17 @@ config = {
     # - taskcluster_firefox_win32_opt
     # - taskcluster_firefox_win64_debug
     # - taskcluster_firefox_win64_opt
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
+        'generate-build-stats'
     ],
     'exes': {
         'python2.7': sys.executable,
         'make': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'build', 'pymake', 'make.py'
             )
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_32_opt.py
@@ -11,16 +11,17 @@ config = {
     # - taskcluster_firefox_win32_opt
     # - taskcluster_firefox_win64_debug
     # - taskcluster_firefox_win64_opt
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
+        'generate-build-stats'
     ],
     'exes': {
         'python2.7': sys.executable,
         'make': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'build', 'pymake', 'make.py'
             )
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_debug.py
@@ -11,16 +11,17 @@ config = {
     # - taskcluster_firefox_win32_opt
     # - taskcluster_firefox_win64_debug
     # - taskcluster_firefox_win64_opt
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
+        'generate-build-stats'
     ],
     'exes': {
         'python2.7': sys.executable,
         'make': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'build', 'pymake', 'make.py'
             )
--- a/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
+++ b/testing/mozharness/configs/builds/taskcluster_firefox_windows_64_opt.py
@@ -11,16 +11,17 @@ config = {
     # - taskcluster_firefox_win32_opt
     # - taskcluster_firefox_win64_debug
     # - taskcluster_firefox_win64_opt
 
     'default_actions': [
         'clone-tools',
         'build',
         'check-test',
+        'generate-build-stats'
     ],
     'exes': {
         'python2.7': sys.executable,
         'make': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'build', 'pymake', 'make.py'
             )
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -1883,16 +1883,22 @@ or run without that action (ie: --no-{ac
                 continue
             data['subtests'].append({
                 'name': phase['name'],
                 'value': phase['duration'],
             })
 
         return data
 
+    def get_firefox_version(self):
+        versionFilePath = os.path.join(
+            self.query_abs_dirs()['abs_src_dir'], 'browser/config/version.txt')
+        with open(versionFilePath, 'r') as versionFile:
+            return versionFile.readline().strip()
+
     def generate_build_stats(self):
         """grab build stats following a compile.
 
         This action handles all statistics from a build: 'count_ctors'
         and then posts to graph server the results.
         We only post to graph server for non nightly build
         """
         if self.config.get('forced_artifact_build'):
@@ -1913,22 +1919,30 @@ or run without that action (ie: --no-{ac
 
         dirs = self.query_abs_dirs()
         packageName = self.query_buildbot_property('packageFilename')
 
         # if packageName is not set because we are not running in Buildbot,
         # then assume we are using MOZ_SIMPLE_PACKAGE_NAME, which means the
         # package is named one of target.{tar.bz2,zip,dmg}.
         if not packageName:
+            firefox_version = self.get_firefox_version()
             dist_dir = os.path.join(dirs['abs_obj_dir'], 'dist')
             for ext in ['apk', 'dmg', 'tar.bz2', 'zip']:
                 name = 'target.' + ext
                 if os.path.exists(os.path.join(dist_dir, name)):
                     packageName = name
                     break
+                # if we are not using MOZ_SIMPLE_PACKAGE_NAME, check for the
+                # default package naming convention
+                name = 'firefox-{}.en-US.{}.{}'.format(
+                    firefox_version, c.get('platform'), ext)
+                if os.path.exists(os.path.join(dist_dir, name)):
+                    packageName = name
+                    break
             else:
                 self.fatal("could not determine packageName")
 
         interests = ['libxul.so', 'classes.dex', 'omni.ja']
         installer = os.path.join(dirs['abs_obj_dir'], 'dist', packageName)
         installer_size = 0
         size_measurements = []