fix(tests): make runner worktree exclusions relative to the search root

Both runners excluded */.claude/worktrees/* by absolute path, which
filtered out every test when the repo itself is a Claude worktree.
Search from inside the root so only nested worktrees are skipped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-16 15:27:25 +00:00
parent 8ce539238c
commit 7380bed6da
4 changed files with 87 additions and 8 deletions

View File

@@ -45,11 +45,17 @@ fi
# land at .claude/skills/<name>/tests/ and be discovered and run a second time,
# which is ADR-0024 consequence 2 arriving here. Keeping the exclusion now is
# what stops that landing as a mystery double-run on the merge that enables it.
#
# The walk runs from inside REPO_ROOT so the exclusions match paths RELATIVE to
# it, the same universe the `git ls-files` grep below sees. Matched against
# absolute paths, `*/.claude/worktrees/*` excluded every file whenever the
# checkout itself was a Claude worktree (<repo>/.claude/worktrees/<name>/), and
# the run failed with "N of N tracked .bats file(s) were not discovered".
TEST_FILES=()
while IFS= read -r f; do
TEST_FILES+=("$f")
TEST_FILES+=("$REPO_ROOT/${f#./}")
done < <(
find "$REPO_ROOT" -name "*.bats" \
cd "$REPO_ROOT" && find . -name "*.bats" \
-not -path "*/tests/bats/*" \
-not -path "*/test_helper/*" \
-not -path "*/.claude/worktrees/*" \