-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Expand file tree
/
Copy pathftr_job_annotation.sh
More file actions
35 lines (30 loc) · 1.2 KB
/
ftr_job_annotation.sh
File metadata and controls
35 lines (30 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Sourced by ftr_configs.sh — do not execute directly.
# Reads globals: exitCode, retry_recovered, annotation_rows, failure_detail_lines,
# JOB, BUILDKITE_RETRY_COUNT, BUILDKITE_COMMIT.
write_job_annotation() {
local attempt_num style
attempt_num=$((${BUILDKITE_RETRY_COUNT:-0} + 1))
style=$([[ "$exitCode" == "0" ]] && echo "success" || echo "error")
{
echo "### FTR Configs — \`${JOB}\` (attempt ${attempt_num})"
echo ""
if [[ "$retry_recovered" == "true" ]]; then
echo "**Recovered on retry** — all originally-failing tests passed; step marked green."
echo ""
echo "> Configs shown as 'still failing' below introduced *new* failures on retry that were not part of the original failure set and are not counted against recovery."
echo ""
fi
if [[ ${#annotation_rows[@]} -gt 0 ]]; then
echo "| Config | Duration | Status |"
echo "| --- | --- | --- |"
printf "%s\n" "${annotation_rows[@]}"
fi
if [[ ${#failure_detail_lines[@]} -gt 0 ]]; then
echo ""
printf "%s\n" "${failure_detail_lines[@]}"
fi
} | buildkite-agent annotate \
--scope job \
--context "ftr-summary" \
--style "${style}" || true
}