Skip to content

Commit ff57c75

Browse files
committed
improve error reporting of script
1 parent 23b9e5d commit ff57c75

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.gitlab/benchmarks.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ benchmarks:
3939
# helper prints SKIP (nothing to do), FULL (whole workspace), or a space-separated crate list;
4040
# BENCH_PACKAGES is consumed by benchmark/run_benchmarks_ci.sh.
4141
- |
42+
set -euo pipefail
4243
DECISION="$(./benchmark/select_bench_packages.sh "${CI_NODE_INDEX:-1}" "${CI_NODE_TOTAL:-1}")"
4344
case "$DECISION" in
4445
SKIP)
@@ -86,6 +87,16 @@ benchmarks:
8687
- ./steps/analyze-results.sh
8788
- "./steps/upload-results-to-s3.sh || :"
8889
- "./steps/upload-results-to-benchmarking-api.sh || :"
90+
# Fail loudly if the run produced no candidate results (e.g. a step exited 0 without actually
91+
# benchmarking); a legitimate skip exits earlier and never reaches here.
92+
- |
93+
set -euo pipefail
94+
shopt -s nullglob
95+
candidate_results=("${ARTIFACTS_DIR}"/candidate/*/benchmark-candidate.converted.json)
96+
if (( ${#candidate_results[@]} == 0 )); then
97+
echo "ERROR: benchmark run produced no candidate results in ${ARTIFACTS_DIR}" >&2
98+
exit 1
99+
fi
89100
# Hand this shard's reports to benchmarks_combine, which posts the single PR comment.
90101
- mv "${ARTIFACTS_DIR}" "${CI_PROJECT_DIR}/reports-${CI_NODE_INDEX:-1}"
91102
artifacts:

0 commit comments

Comments
 (0)