From 9302b3ebb900a949f111270738f478ede7251f54 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Fri, 15 May 2026 00:40:28 +0200 Subject: [PATCH] smoke-test: replace ((VAR++)) with VAR=$((VAR+1)) to avoid set -e exit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ((VAR++)) returns the OLD value, so when PASS=0 the first ✅ check caused exit code 1, killing the script under set -e. Use VAR=$((VAR+1)) which always returns 0. Same pattern as opencode-devbox's smoke-test. --- scripts/smoke-test.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh index d7e8dad..cb62e23 100755 --- a/scripts/smoke-test.sh +++ b/scripts/smoke-test.sh @@ -22,9 +22,9 @@ SIZE_THRESHOLD_MB=2200 run() { local label="$1"; local cmd="$2" if docker run --rm --entrypoint="" "$IMAGE" sh -c "$cmd" >/dev/null 2>&1; then - printf " ✅ %s\n" "$label"; ((PASS++)) + printf " ✅ %s\n" "$label"; PASS=$((PASS+1)) else - printf " ❌ %s\n" "$label"; ((FAIL++)) + printf " ❌ %s\n" "$label"; FAIL=$((FAIL+1)) fi } @@ -65,9 +65,9 @@ done exec_test() { local label="$1"; local cmd="$2" if docker exec "$CID" sh -c "$cmd" >/dev/null 2>&1; then - printf " ✅ %s\n" "$label"; ((PASS++)) + printf " ✅ %s\n" "$label"; PASS=$((PASS+1)) else - printf " ❌ %s\n" "$label"; ((FAIL++)) + printf " ❌ %s\n" "$label"; FAIL=$((FAIL+1)) fi } @@ -81,9 +81,9 @@ echo "" echo "── Image size ──" SIZE_MB=$(docker image inspect "$IMAGE" --format='{{.Size}}' | awk '{printf "%d", $1/1048576}') if [ "$SIZE_MB" -le "$SIZE_THRESHOLD_MB" ]; then - printf " ✅ size: %d MB (threshold %d MB)\n" "$SIZE_MB" "$SIZE_THRESHOLD_MB"; ((PASS++)) + printf " ✅ size: %d MB (threshold %d MB)\n" "$SIZE_MB" "$SIZE_THRESHOLD_MB"; PASS=$((PASS+1)) else - printf " ❌ size: %d MB exceeds threshold %d MB\n" "$SIZE_MB" "$SIZE_THRESHOLD_MB"; ((FAIL++)) + printf " ❌ size: %d MB exceeds threshold %d MB\n" "$SIZE_MB" "$SIZE_THRESHOLD_MB"; FAIL=$((FAIL+1)) fi # ── Summary ───────────────────────────────────────────────────────────