Skip to content

Commit

Permalink
Fix crash due to aborted test targets (#1876)
Browse files Browse the repository at this point in the history
Related to
#1708
  • Loading branch information
fweikert committed Feb 8, 2024
1 parent 7b7631d commit ce87454
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion buildkite/bazelci.py
Original file line number Diff line number Diff line change
Expand Up @@ -4026,13 +4026,20 @@ def get_test_results_from_bep(path):
with open(path, "rt") as f:
for line in f:
if "testResult" not in line:
# TODO: also look at targetCompleted events that don't have
# a matching testResult event, since these are FAILED_TO_BUILD
continue

data = json.loads(line)
meta = data.get("id").get("testResult")
meta = data.get("id", {}).get("testResult")
if not meta:
continue

if "testResult" not in data:
# No testResult field means "aborted" -> NO_STATUS
# TODO: show these targets in the UI?
continue

yield (
meta["label"],
meta["shard"],
Expand Down

0 comments on commit ce87454

Please sign in to comment.