mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-12 05:36:40 +00:00
fix(test): resolve self-exclusion bug in environment orchestrator
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 <noreply@anthropic.com>
This commit is contained in:
1 parent
2303901d93
commit
fb2de0e6b6
1 file changed
+4
-1
@@ -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 "============================================================"
|
||||
|
||||
Reference in new issue
Block a user