fix(tests): exclude build/ from bats test discovery #141
Reference in New Issue
Block a user
Delete Branch "fix/bats-repo-root-resolution"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
tests/run-bats.sh's test-discovery walk excludedapm_modules/and.claude/skills/(apm-installed copies of the same*.batsfiles, one directory level shallower than theirplugins/*/.apm/source) but was missing the same exclusion forbuild/— theapm packstaging output, which hits the identical failure mode from a different apm subcommand.apm packrun leavesbuild/<package>-<version>/on disk (gitignored, regenerable). Its staged.batscopies carry the same hardcoded six-levels-upREPO_ROOTwalk in each test'ssetup(), which overshoots the real repo root when run from the shallowerbuild/layout and fails to find thetests/test_helper/bats-supportsubmodule — silently doubling the suite (846 tests instead of 423) with 423 of them failing.-not -path "*/build/*"to thefindwalk and the matchinggit ls-filesgrep exclusion, mirroring the existingapm_modules//.claude/skills/entries.tests/test-run-bats.shwith a regression case following the same pattern as the existing exclusion-bug fixtures.Verification
bash tests/run-bats.sh(with a straybuild/holocron-*/still on disk): 846/423-failing → 423/0-failing after the fix.bash tests/run-tests.sh --strict(the actualrun-testspre-commit/pre-push hook entry): exit 0,=== Summary: 21 passed, 0 skipped, 0 failed ===.bash tests/test-run-bats.sh: 15 passed, 0 failed (was 14).apm audit --ciandapm pack --check-clean: pass.git.rkdr.net.Test plan
bash tests/run-tests.sh --strictpassesbash tests/test-run-bats.shpasses with the new caseapm audit --ci/apm pack --check-cleanpassUnrelated to and independent of the separate
chore/git-host-migrationPR.🤖 Generated with Claude Code
https://claude.ai/code/session_011EBLjPSWgt4N5Q47sH8bSV