From 55be59516d2efe9752279ff96971719e3e6d591d Mon Sep 17 00:00:00 2001 From: danielmeppiel Date: Sat, 14 Mar 2026 13:50:10 +0100 Subject: [PATCH] fix: release validation exits silently due to sourced set -e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test-dependency-integration.sh had `set -euo pipefail` which, when sourced into test-release-validation.sh, re-enabled -e that the parent script deliberately removed. This caused `((tests_passed++))` (where tests_passed starts at 0) to evaluate to 0 → exit code 1 → immediate script termination under -e. Fix: remove -e from the sourced file (keep -uo pipefail) and delete dead code in check_prerequisites that was unreachable after an early return. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- scripts/test-dependency-integration.sh | 7 ++++++- scripts/test-release-validation.sh | 12 ------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/scripts/test-dependency-integration.sh b/scripts/test-dependency-integration.sh index 5a26bb1f..966adc3e 100755 --- a/scripts/test-dependency-integration.sh +++ b/scripts/test-dependency-integration.sh @@ -3,7 +3,12 @@ # Tests real dependency scenarios with actual GitHub repositories # Used in CI pipeline for comprehensive dependency validation -set -euo pipefail +# NOTE: Do NOT use `set -e` here — this file is `source`d into +# test-release-validation.sh which deliberately avoids -e for its own +# error-handling strategy. Setting -e here would re-enable it for the +# sourcing script, causing silent early exits (e.g. `((count++))` when +# count is 0 returns exit-code 1 under -e). +set -uo pipefail # Colors for output RED='\033[0;31m' diff --git a/scripts/test-release-validation.sh b/scripts/test-release-validation.sh index 5a71a207..588de900 100755 --- a/scripts/test-release-validation.sh +++ b/scripts/test-release-validation.sh @@ -94,18 +94,6 @@ check_prerequisites() { log_error "GitHub token setup failed" return 1 fi - - # Set up GitHub tokens for testing - # No specific NPM authentication needed for public runtimes - if [[ -n "${GITHUB_APM_PAT:-}" ]]; then - log_success "GITHUB_APM_PAT is set (APM module access)" - export GITHUB_APM_PAT="${GITHUB_APM_PAT}" - fi - - if [[ -n "${GITHUB_TOKEN:-}" ]]; then - log_success "GITHUB_TOKEN is set (GitHub Models access)" - export GITHUB_TOKEN="${GITHUB_TOKEN}" - fi } # Test Step 2: apm runtime setup (both copilot and codex for full coverage)