Bug 1362148 - Don't collect package metrics for some Android builds; r?ted draft
authorGregory Szorc <gps@mozilla.com>
Fri, 12 May 2017 13:24:28 -0700
changeset 577091 1574ea915aaba005e2554615dcbadb7dbc60925a
parent 577090 c66b8ab98a720404fa42cc074a44343a54270bba
child 577092 de51c1bd0c4b48395236f72cd62e39529cd9f3c5
push id58600
push userbmo:gps@mozilla.com
push dateFri, 12 May 2017 20:26:18 +0000
reviewersted
bugs1362148
milestone55.0a1
Bug 1362148 - Don't collect package metrics for some Android builds; r?ted We're about to enable metrics collection for all builds. There are some Android build configurations that use buildbase.py but don't create a package. So we need a way to conditionally obtain package metrics. We could change package metrics collection to no-op if a package file can't be found. However, that has a risk that a future change could break metrics collection and we wouldn't necessarily find out. I like things that fail fast. MozReview-Commit-ID: CzByf7yHVS8
testing/mozharness/configs/builds/releng_sub_android_configs/64_checkstyle.py
testing/mozharness/configs/builds/releng_sub_android_configs/64_findbugs.py
testing/mozharness/configs/builds/releng_sub_android_configs/64_lint.py
testing/mozharness/configs/builds/releng_sub_android_configs/64_test.py
testing/mozharness/mozharness/mozilla/building/buildbase.py
--- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_checkstyle.py
+++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_checkstyle.py
@@ -1,12 +1,14 @@
 config = {
     'base_name': 'Android checkstyle %(branch)s',
     'stage_platform': 'android-checkstyle',
     'build_type': 'api-15-opt',
     'src_mozconfig': 'mobile/android/config/mozconfigs/android-api-15-frontend/nightly',
     'tooltool_manifest_src': 'mobile/android/config/tooltool-manifests/android-frontend/releng.manifest',
     'multi_locale_config_platform': 'android',
+    # checkstyle doesn't produce a package. So don't collect package metrics.
+    'disable_package_metrics': True,
     'postflight_build_mach_commands': [
         ['gradle', 'app:checkstyle'],
     ],
     'artifact_flag_build_variant_in_try': None, # There's no artifact equivalent.
 }
--- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_findbugs.py
+++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_findbugs.py
@@ -1,15 +1,17 @@
 config = {
     'base_name': 'Android findbugs %(branch)s',
     'stage_platform': 'android-findbugs',
     'build_type': 'api-15-opt',
     'src_mozconfig': 'mobile/android/config/mozconfigs/android-api-15-frontend/nightly',
     'tooltool_manifest_src': 'mobile/android/config/tooltool-manifests/android-frontend/releng.manifest',
     'multi_locale_config_platform': 'android',
+    # findbugs doesn't produce a package. So don't collect package metrics.
+    'disable_package_metrics': True,
     'postflight_build_mach_commands': [
         ['gradle',
          'app:findbugsOfficialAustralisDebug',
          'app:findbugsOfficialPhotonDebug',
         ],
     ],
     'artifact_flag_build_variant_in_try': None, # There's no artifact equivalent.
 }
--- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_lint.py
+++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_lint.py
@@ -1,15 +1,17 @@
 config = {
     'base_name': 'Android lint %(branch)s',
     'stage_platform': 'android-lint',
     'build_type': 'api-15-opt',
     'src_mozconfig': 'mobile/android/config/mozconfigs/android-api-15-frontend/nightly',
     'tooltool_manifest_src': 'mobile/android/config/tooltool-manifests/android-frontend/releng.manifest',
     'multi_locale_config_platform': 'android',
+    # lint doesn't produce a package. So don't collect package metrics.
+    'disable_package_metrics': True,
     'postflight_build_mach_commands': [
         ['gradle',
          'app:lintOfficialAustralisDebug',
          'app:lintOfficialPhotonDebug',
         ],
     ],
     'artifact_flag_build_variant_in_try': None, # There's no artifact equivalent.
 }
--- a/testing/mozharness/configs/builds/releng_sub_android_configs/64_test.py
+++ b/testing/mozharness/configs/builds/releng_sub_android_configs/64_test.py
@@ -1,15 +1,17 @@
 config = {
     'base_name': 'Android armv7 unit tests %(branch)s',
     'stage_platform': 'android-test',
     'build_type': 'api-15-opt',
     'src_mozconfig': 'mobile/android/config/mozconfigs/android-api-15-frontend/nightly',
     'tooltool_manifest_src': 'mobile/android/config/tooltool-manifests/android-frontend/releng.manifest',
     'multi_locale_config_platform': 'android',
+    # unit tests don't produce a package. So don't collect package metrics.
+    'disable_package_metrics': True,
     'postflight_build_mach_commands': [
         ['gradle',
          'app:testOfficialAustralisDebugUnitTest',
          'app:testOfficialPhotonDebugUnitTest',
         ],
     ],
     'artifact_flag_build_variant_in_try': None, # There's no artifact equivalent.
 }
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -2033,17 +2033,17 @@ or run without that action (ie: --no-{ac
 
         perfherder_data = {
             "framework": {
                 "name": "build_metrics"
             },
             "suites": [],
         }
 
-        if not c.get('debug_build'):
+        if not c.get('debug_build') or c.get('disable_package_metrics'):
             perfherder_data['suites'].extend(self._get_package_metrics())
 
         # Extract compiler warnings count.
         warnings = self.get_output_from_command(
             command=[sys.executable, 'mach', 'warnings-list'],
             cwd=self.query_abs_dirs()['abs_src_dir'],
             env=self.query_build_env(),
             # No need to pollute the log.