Bug 1430170 - Use correct path to gcda file and fail build if grcov fails. r=jmaher
authorMarco Castelluccio <mcastelluccio@mozilla.com>
Fri, 12 Jan 2018 17:12:45 +0100
changeset 450873 a438b7e7917ee604f8613714c9f96ce4968e4701
parent 450872 d16fe1a6931e5dadaeddafd626ef5bc0bb8bf8ea
child 450874 792b172327f28a7d90aa51c38c26dff23cc06032
push id8543
push userryanvm@gmail.com
push dateTue, 16 Jan 2018 14:33:22 +0000
treeherdermozilla-beta@a6525ed16a32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1430170
milestone59.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 1430170 - Use correct path to gcda file and fail build if grcov fails. r=jmaher
testing/mozharness/mozharness/mozilla/testing/codecoverage.py
--- a/testing/mozharness/mozharness/mozilla/testing/codecoverage.py
+++ b/testing/mozharness/mozharness/mozilla/testing/codecoverage.py
@@ -155,17 +155,17 @@ class CodeCoverageMixin(object):
         del os.environ['GCOV_PREFIX_STRIP']
         del os.environ['GCOV_PREFIX']
         del os.environ['JS_CODE_COVERAGE_OUTPUT_DIR']
 
         if not self.ccov_upload_disabled:
             dirs = self.query_abs_dirs()
 
             # Zip gcda files (will be given in input to grcov).
-            file_path_gcda = 'code-coverage-gcda.zip'
+            file_path_gcda = os.path.join(os.getcwd(), 'code-coverage-gcda.zip')
             self.run_command(['zip', '-q', '-0', '-r', file_path_gcda, '.'], cwd=self.gcov_dir)
 
             # Package JSVM coverage data.
             file_path_jsvm = os.path.join(dirs['abs_blob_upload_dir'], 'code-coverage-jsvm.zip')
             self.run_command(['zip', '-r', file_path_jsvm, '.'], cwd=self.jsvm_dir)
 
             # GRCOV post-processing
             # Download the gcno fom the build machine.
@@ -184,17 +184,18 @@ class CodeCoverageMixin(object):
                 grcov_command += ['--llvm']
 
             # 'grcov_output' will be a tuple, the first variable is the path to the lcov output,
             # the other is the path to the standard error output.
             grcov_output, _ = self.get_output_from_command(
                 grcov_command,
                 silent=True,
                 save_tmpfiles=True,
-                return_type='files'
+                return_type='files',
+                throw_exception=True,
             )
             output_file_name = 'grcov_lcov_output.info'
             shutil.move(grcov_output, os.path.join(self.grcov_dir, output_file_name))
 
             # Zip the grcov output and upload it.
             self.run_command(
                 ['zip', os.path.join(dirs['abs_blob_upload_dir'], 'code-coverage-grcov.zip'), output_file_name],
                 cwd=self.grcov_dir