From fb2de0e6b635a4b84cd04ef58cf2fd052d4ed549 Mon Sep 17 00:00:00 2001 From: Environment Test Date: Sat, 11 Apr 2026 02:09:37 +0200 Subject: [PATCH] fix(test): resolve self-exclusion bug in environment orchestrator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The self-exclusion check compared BASH_SOURCE[0] (relative path when invoked as `bash ./scripts/…/00_orchestrator.sh`) against the glob-built step paths (always absolute). The mismatch caused the orchestrator to include itself in the loop, running a full inner pass of steps 01–10 before the outer loop repeated them — doubling the total runtime. Fix: resolve SELF to an absolute path using SCRIPT_DIR so the comparison is always path-equivalent regardless of invocation style. Co-Authored-By: Claude Sonnet 4.6 --- scripts/tests/environment/00_orchestrator.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/tests/environment/00_orchestrator.sh b/scripts/tests/environment/00_orchestrator.sh index 508cf5b22f..1988b55f9d 100755 --- a/scripts/tests/environment/00_orchestrator.sh +++ b/scripts/tests/environment/00_orchestrator.sh @@ -8,6 +8,9 @@ unset GITHUB_ACTIONS unset ACT SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Resolve to an absolute path so the self-exclusion works regardless of whether +# the script was invoked with a relative path (e.g. bash ./scripts/…/00_orchestrator.sh). +SELF="${SCRIPT_DIR}/$(basename "${BASH_SOURCE[0]}")" # shellcheck source=scripts/tests/environment/lib.sh source "${SCRIPT_DIR}/lib.sh" @@ -15,7 +18,7 @@ source "${SCRIPT_DIR}/lib.sh" cd "${REPO_ROOT}" for step in "${SCRIPT_DIR}"/[0-9][0-9]_*.sh; do - [[ "${step}" == "${BASH_SOURCE[0]}" ]] && continue + [[ "${step}" == "${SELF}" ]] && continue load_repo_env ensure_git_safe_directory echo "============================================================"