From fdd28c42e9c53398b5acb958258c6853d98d48ba Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Thu, 11 Oct 2018 13:52:49 -0700 Subject: [PATCH] [infra] Add srcmap step to code coverage job (follow-up #1547). (#1868) --- infra/gcb/build_and_run_coverage.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/infra/gcb/build_and_run_coverage.py b/infra/gcb/build_and_run_coverage.py index 12f7f7724..babf85f67 100644 --- a/infra/gcb/build_and_run_coverage.py +++ b/infra/gcb/build_and_run_coverage.py @@ -92,6 +92,15 @@ def get_build_steps(project_dir): ], 'dir': 'oss-fuzz/projects/' + name, }, + { + 'name': + image, + 'args': [ + 'bash', '-c', + 'srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json' + ], + 'env': ['OSSFUZZ_REVISION=$REVISION_ID'], + }, ] env = CONFIGURATION[:] @@ -204,6 +213,21 @@ def get_build_steps(project_dir): } ) + # Upload srcmap. + srcmap_upload_url = UPLOAD_URL_FORMAT.format( + project=project_name, type='srcmap', date=report_date) + srcmap_upload_url = srcmap_upload_url.rstrip('/') + '.json' + build_steps.append( + { + 'name': 'gcr.io/cloud-builders/gsutil', + 'args': [ + 'cp', + '/workspace/srcmap.json', + srcmap_upload_url, + ], + } + ) + # Update the latest report information file for ClusterFuzz. latest_report_info_url = build_project.get_signed_url( LATEST_REPORT_INFO_URL.format(project=project_name),