Skip to content

Commit ed2c894

Browse files
authored
Handle null case in macrobenchmark (#6525)
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.
1 parent 866e6bd commit ed2c894

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ci/fireci/fireciplugins/macrobenchmark/commands.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ def ci(pull_request: bool, changed_modules_file: Path, repeat: int):
173173
with open(output_path) as output_file:
174174
output = json.load(output_file)
175175
project_name = 'test-changed' if pull_request else 'test-all'
176-
ftl_dirs = list(filter(lambda x: x['project'] == project_name, output))[0]['successful_runs']
176+
ftl_run = list(filter(lambda x: x['project'] == project_name, output))
177+
if not ftl_run:
178+
logger.warning(f'No output for "{project_name}", ignoring.')
179+
return
180+
ftl_dirs = ftl_run[0]['successful_runs']
177181
ftl_bucket_name = 'fireescape-benchmark-results'
178182

179183
log = ci_utils.ci_log_link()

0 commit comments

Comments
 (0)