Files
boshu2__agentops/tests/scripts/test-check-test-fixture-parity.bats
Bo 1d4c003e05 Cut plan: gate registry diet, legacy bash gate removal, CI collapse, pawl warm-service removal (#906)
## Summary
- **Wave 1** — remove the `always.wiring-closure` meta-gate, demote
`docs.skill-refs` to Full tier, delete 8 orphan scripts.
- **Wave 2** — delete the legacy bash pre-push gate (`pre-push-gate.sh`,
2,279 lines) and its parity machinery; collapse `validate.yml` from 18
jobs to 5.
- **Wave 3** — remove the pawl warm NTM standing service; the cold
review spine (pawl-review / pawl-verdict / pre-push check) is untouched.
- **Wave 4** — gate registry diet: cut 24 doctrine/meta check IDs and
~70 backing scripts/workflows/bats; trim nightly knowledge-cycle job.

Net: gate registry 112 → 83 checks (incl. main's additions), ~24k lines
of scripts/CI/bats deleted. Routine one-file fast gate now runs in ~19s.

## Test plan
- [x] `go build` / `go vet` / gates+goals+ports package tests green
- [x] `ao gate check --fast --scope range:origin/main..HEAD` — 66
passed, 0 failed, 1 skipped (199 changed files)
- [x] `validate-ci-policy-parity.sh` PASS; validate.yml / nightly.yml
parse
- [x] `regen-changed-scope --check` green; registry.json regenerated
- [x] Grepped tree for dangling references to every deleted script/check
ID

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: boshu <241868352+boshu2@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-13 14:45:20 -04:00

66 lines
1.8 KiB
Bash

#!/usr/bin/env bats
# tests/scripts/test-check-test-fixture-parity.bats
#
# Coverage for scripts/check-test-fixture-parity.sh (hooks-only after Wave 2).
setup() {
REPO_ROOT="$(cd "$BATS_TEST_DIRNAME/../.." && pwd)"
SCRIPT="$REPO_ROOT/scripts/check-test-fixture-parity.sh"
TMP_DIR="$(mktemp -d)"
FAKE_REPO="$TMP_DIR/repo"
mkdir -p "$FAKE_REPO/hooks" \
"$FAKE_REPO/scripts" \
"$FAKE_REPO/tests/hooks" \
"$FAKE_REPO/tests/scripts" \
"$FAKE_REPO/tests/skills"
}
teardown() {
rm -rf "$TMP_DIR"
}
write_hook_coverage() {
{
echo '#!/usr/bin/env bash'
for ref in "$@"; do
echo "# covers: $ref"
done
} > "$FAKE_REPO/tests/hooks/test-hooks.sh"
{
echo '#!/usr/bin/env bats'
for ref in "$@"; do
echo "# covers: $ref"
done
} > "$FAKE_REPO/tests/hooks/test-hooks.bats"
}
@test "PASS on clean fixture (all hooks covered)" {
echo '#!/usr/bin/env bash' > "$FAKE_REPO/hooks/foo.sh"
echo '#!/usr/bin/env bash' > "$FAKE_REPO/hooks/bar.sh"
write_hook_coverage "foo" "bar"
run "$SCRIPT" "$FAKE_REPO"
[ "$status" -eq 0 ]
[ -z "$output" ]
}
@test "FAIL: hook present without test coverage" {
echo '#!/usr/bin/env bash' > "$FAKE_REPO/hooks/foo.sh"
echo '#!/usr/bin/env bash' > "$FAKE_REPO/hooks/orphan.sh"
write_hook_coverage "foo"
run "$SCRIPT" "$FAKE_REPO"
[ "$status" -eq 1 ]
[[ "$output" == *"hooks with no test coverage"* ]]
[[ "$output" == *"orphan"* ]]
}
@test "Bypass via AGENTOPS_PARITY_GATE_DISABLED" {
echo '#!/usr/bin/env bash' > "$FAKE_REPO/hooks/orphan.sh"
write_hook_coverage
AGENTOPS_PARITY_GATE_DISABLED=1 run "$SCRIPT" "$FAKE_REPO"
[ "$status" -eq 0 ]
[[ "$output" == *"skipped"* ]]
}