aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-15 23:04:13 -0500
committerCraig Jennings <c@cjennings.net>2026-05-15 23:04:13 -0500
commit7ef200a4969a31ae6976b87eb78494f7917b3200 (patch)
tree0cd6f147031a2f07625aa752b56b572998649cee /Makefile
parentdc1661c222304dddd797bece882bb2501d2b6e76 (diff)
downloadrulesets-7ef200a4969a31ae6976b87eb78494f7917b3200.tar.gz
rulesets-7ef200a4969a31ae6976b87eb78494f7917b3200.zip
test(scripts): add bats harness for audit + install-ai edge cases
Adds scripts/tests/audit.bats (6 tests) and scripts/tests/install-ai.bats (5 tests) covering the three destructive edge cases that the fold-epic test plan deferred yesterday: audit --apply --force clobbering a tracked dirty .ai/, audit's loop continuing past a missing-.ai/ project, and install-ai's interactive fzf-pick form. The first two go alongside happy-path sanity (clean sweep, drift detection, --apply convergence, dirty-skip); install-ai gets happy-path with explicit PROJECT, --track gitkeep stubs, refusal on existing .ai/, and notes.org placeholder substitution. Strategy: redirect HOME to a per-test mktemp dir, scaffold synthetic project trees under HOME/code/, and run the real scripts against them. The canonical source stays the real one (resolved relative to each script's own location), so tests exercise the production rsync paths without copying canonical content. Use PATH stubs for fzf and find to cover the interactive and race-condition edges. Makefile test: target extended with a bats stanza; description updated to "Run all test suites (pytest + ERT + bats)". make test now runs 352 green (296 pytest + 22 lint-org ERT + 23 todo-cleanup ERT + 6 audit bats + 5 install-ai bats), up from 341.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 9b41bc3..34b6e56 100644
--- a/Makefile
+++ b/Makefile
@@ -416,10 +416,15 @@ install-ai: ## Bootstrap .ai/ in a fresh project ([PROJECT=<path>] [TRACK=1 | GI
catchup-machine: ## Pull rulesets, refresh install, sync .ai/ across projects, verify doctor
@bash scripts/catchup-machine.sh
-test: ## Run the .ai/scripts/ test suites (pytest + ERT)
+test: ## Run all test suites (pytest + ERT + bats)
@cd .ai/scripts/tests && python3 -m pytest
@set -e; for f in .ai/scripts/tests/test-*.el; do \
[ -e "$$f" ] || continue; \
echo "ert: $$(basename "$$f")"; \
emacs --batch -q -L .ai/scripts -l ert -l "$$f" -f ert-run-tests-batch-and-exit; \
done
+ @set -e; for f in scripts/tests/*.bats; do \
+ [ -e "$$f" ] || continue; \
+ echo "bats: $$(basename "$$f")"; \
+ bats "$$f"; \
+ done