Bug 1457629 - Don't create per-test-coverage-reports.zip when no tests are run. r=marco
authorGregory Mierzwinski <gmierz2@outlook.com>
Sun, 29 Apr 2018 16:28:57 -0400
changeset 472437 ad861c124e5d793c3cb776ec3e50088a4786d547
parent 472436 76583b160138ca2ea6fcb71876c3ef2c7e4d48e0
child 472438 645f4840341e77d312eebf31283b01698556c4ea
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarco
bugs1457629
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 1457629 - Don't create per-test-coverage-reports.zip when no tests are run. r=marco This patch stops test-coverage (TC/TCw) from trying to create a zip file of the per-test coverage reports when no tests are run. MozReview-Commit-ID: 6m3TR4oUCLx
testing/mozharness/mozharness/mozilla/testing/codecoverage.py
--- a/testing/mozharness/mozharness/mozilla/testing/codecoverage.py
+++ b/testing/mozharness/mozharness/mozilla/testing/codecoverage.py
@@ -284,16 +284,20 @@ class CodeCoverageMixin(SingleTestMixin)
 
             self.info("Completed compression of JSDCov artifacts!")
             self.info("Path to JSDCov compressed artifacts: " + zipFile)
 
         if not self.code_coverage_enabled:
             return
 
         if self.per_test_coverage:
+            if not self.per_test_reports:
+                self.info("No tests were found...not saving coverage data.")
+                return
+
             dest = os.path.join(dirs['abs_blob_upload_dir'], 'per-test-coverage-reports.zip')
             with zipfile.ZipFile(dest, 'w', zipfile.ZIP_DEFLATED) as z:
                 for suite, data in self.per_test_reports.items():
                     for test, grcov_file in data.items():
                         with open(grcov_file, 'r') as f:
                             report = json.load(f)
 
                         # TODO: Diff this coverage report with the baseline one.