From c4d08bf6081cde716b748d91948328e6b97fdff2 Mon Sep 17 00:00:00 2001 From: Rodrigo Lazo Paz Date: Wed, 20 Nov 2024 11:46:05 -0500 Subject: [PATCH] Handle null case in macrobenchmark There are some scenarios in which we can't find the valid output for a given project. We need to log and continue instead of crashing. --- ci/fireci/fireciplugins/macrobenchmark/commands.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/fireci/fireciplugins/macrobenchmark/commands.py b/ci/fireci/fireciplugins/macrobenchmark/commands.py index 430668240b4..1d5395d795f 100644 --- a/ci/fireci/fireciplugins/macrobenchmark/commands.py +++ b/ci/fireci/fireciplugins/macrobenchmark/commands.py @@ -173,7 +173,11 @@ def ci(pull_request: bool, changed_modules_file: Path, repeat: int): with open(output_path) as output_file: output = json.load(output_file) project_name = 'test-changed' if pull_request else 'test-all' - ftl_dirs = list(filter(lambda x: x['project'] == project_name, output))[0]['successful_runs'] + ftl_run = list(filter(lambda x: x['project'] == project_name, output)) + if not ftl_run: + logger.warning(f'No output for "{project_name}", ignoring.') + return + ftl_dirs = ftl_run[0]['successful_runs'] ftl_bucket_name = 'fireescape-benchmark-results' log = ci_utils.ci_log_link()