Skip to content

Commit

Permalink
fix es ingest for missing files (#11375)
Browse files Browse the repository at this point in the history
If a job fails at build time, there are not test logs to process.
Currently this means the ingestion process is going to be stuck in an
endless loop of retrying that job and failing on the missing file.

This change should let us process jobs with no test files.

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
garyverhaegen-da committed Oct 25, 2021
1 parent 03cfd12 commit 5654d5c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions infra/es_cluster.tf
Expand Up @@ -784,7 +784,7 @@ bulk_upload() {
}
patch() {
local job map
local job map file
job="$1"
# Replace shortened Scala test names by their long names.
# See //bazel_tools:scala.bzl%da_scala_test_short_name_aspect.
Expand All @@ -796,7 +796,12 @@ patch() {
# Generates a sed command to replace short labels by long labels.
jq_command='to_entries | map("s|\(.key)\\b|\(.value)|g") | join(";")'
sed_command="$(jq -r "$jq_command" <"$job/$map")"
sed -i "$sed_command" "$job"/{build-events,build-profile,test-events,test-profile}.json
for f in build-events build-profile test-events test-profile; do
file="$job/$f.json"
if [ -f "$file" ]; then
sed -i "$sed_command" "$file"
fi
done
fi
}
Expand Down

0 comments on commit 5654d5c

Please sign in to comment.