From 9e9ed9bb7e2247b1f9474ddb35bea736b9c8603d Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Thu, 17 Oct 2024 20:34:19 +0100 Subject: [PATCH] infra: build: introspector: upload artifacts in all cases (#12609) Upload introspector report even when build fails. This is to ensure artifacts from FI light is uploaded for each build. --------- Signed-off-by: David Korczynski --- infra/build/functions/build_and_run_coverage.py | 6 +++++- infra/build/functions/build_project.py | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/infra/build/functions/build_and_run_coverage.py b/infra/build/functions/build_and_run_coverage.py index a58dc7125684..48ba786e8b1c 100755 --- a/infra/build/functions/build_and_run_coverage.py +++ b/infra/build/functions/build_and_run_coverage.py @@ -316,7 +316,11 @@ def get_fuzz_introspector_steps( # pylint: disable=too-many-locals, too-many-ar env.append(f'PROJECT_NAME={project.name}') build_steps.append( - build_project.get_compile_step(project, build, env, config.parallel)) + build_project.get_compile_step(project, + build, + env, + config.parallel, + allow_failure=True)) # Upload the report. upload_report_url = bucket.get_upload_url('inspector-report') diff --git a/infra/build/functions/build_project.py b/infra/build/functions/build_project.py index 7c4ff7f142f1..b5d35f156900 100755 --- a/infra/build/functions/build_project.py +++ b/infra/build/functions/build_project.py @@ -243,7 +243,12 @@ def get_env(fuzzing_language, build): return list(sorted([f'{key}={value}' for key, value in env_dict.items()])) -def get_compile_step(project, build, env, parallel, upload_build_logs=None): +def get_compile_step(project, + build, + env, + parallel, + upload_build_logs=None, + allow_failure=False): """Returns the GCB step for compiling |projects| fuzzers using |env|. The type of build is specified by |build|.""" failure_msg = ( @@ -277,7 +282,7 @@ def get_compile_step(project, build, env, parallel, upload_build_logs=None): 'id': get_id('compile', build), } - if upload_build_logs: + if upload_build_logs or allow_failure: # The failure will be reported in a subsequent step. compile_step['allowFailure'] = True