a failed upload is measured as failure, not as a number

The upload loop is xargs, and a failed child is exit 123 on GNU and exit 1 on
BSD, so pinning either one passes on the machine it was written on and reds on
the other. What the case is about is that the deploy fails at all.
This commit is contained in:
Antje Worring
2026-08-13 23:32:04 -07:00
parent 25b9078921
commit 0dcc3ad641
+4 -1
View File
@@ -205,7 +205,10 @@ rm -f "$tmp/calls" "$tmp/complete.body"
out=$(PATH="$shim:$PATH" HANZO_API=https://api.test HANZO_DEPLOY_TOKEN=sk-test \
SITEDEPLOY_JOBS=1 T_DIR="$tmp" T_ENQ="${ENQ/https:\/\/s3.test/https:\/\/s3.unknown}" T_DONE="$DONE" \
bash "$SD" a-slug "$site" 2>&1); rc=$?
t "a failed upload fails the deploy" "$rc" "1"
# Non-zero, not a number: the upload loop is xargs, and a failed child is exit
# 123 on GNU and exit 1 on BSD. Pinning either one passes on the machine it was
# written on and reds on the other.
t "a failed upload fails the deploy" "$([ "$rc" != 0 ] && echo failed)" "failed"
t "a failed upload is reported as error" "$(jq -r .status "$tmp/complete.body" 2>/dev/null)" "error"
[ $fail -eq 0 ] && echo "PASS" || echo "FAIL"