Skip to content

fix: reconcile regression gate test scope with documented full-suite policy#641

Open
dennisonbertram wants to merge 1 commit into
mainfrom
deep-claude/issue-568-test--reconcile-regression-gate-scope-with-documen
Open

fix: reconcile regression gate test scope with documented full-suite policy#641
dennisonbertram wants to merge 1 commit into
mainfrom
deep-claude/issue-568-test--reconcile-regression-gate-scope-with-documen

Conversation

@dennisonbertram

Copy link
Copy Markdown
Owner

Summary

Reconciles the regression test gate scope with the documented full-suite policy in docs/runbooks/testing.md.

Problem

  • scripts/test-regression.sh used hardcoded ./internal/... ./cmd/... as its test scope
  • docs/runbooks/testing.md documented the regression gate as enforcing go test ./...
  • The mismatch meant operators and agents couldn't trust the docs/script contract

Solution

  • scripts/test-regression.sh: Changed PKG_PATTERNS default from ./internal/... ./cmd/... to ./..., derived via go list ${PKG_PATTERNS}. Kept the variable overridable for flexibility.
  • Added COVER_PKG_PATTERNS (defaults to ./internal/... ./cmd/...) so the coverage gate remains practical on core packages while tests run against the full module.
  • Added drift tests in internal/quality/repostructure/regression_scope_test.go that:
    • Assert the script defaults PKG_PATTERNS to ./...
    • Assert the script has a separate coverage scope for core packages
    • Assert the docs reference go test ./...
    • Assert script and docs agree on scope (drift guard)

Test Results

  • go test ./internal/quality/repostructure -count=1 -- all 6 tests PASS (including 4 new drift tests)
  • go test ./cmd/coveragegate -count=1 -- all 5 tests PASS
  • go test ./internal/... ./cmd/... -count=1 -- all packages PASS
  • go test ./... -count=1 -- all packages PASS
  • ./scripts/test-regression.sh -- go test and go test -race steps PASS on full ./... scope; coverage gate reports pre-existing zero-coverage functions (not caused by this change).

Design Decisions

  • Test scope widened to ./... to match documented full-suite policy
  • Coverage scope kept at ./internal/... ./cmd/... to keep the 80% threshold practical
  • Both scopes overridable via env vars for CI flexibility
  • Drift tests prevent silent regression of the docs/script contract

Closes #568

🤖 Generated with Claude Code

…policy

Change PKG_PATTERNS default from ./internal/... ./cmd/... to ./... so
the regression script enforces the full-suite test policy documented in
docs/runbooks/testing.md.

- PKG_PATTERNS now defaults to ./... and is derived with go list ${PKG_PATTERNS}
- Added COVER_PKG_PATTERNS (defaults to ./internal/... ./cmd/...) so the
  coverage gate stays practical on the core packages while tests run on the
  full module.
- Added drift tests in internal/quality/repostructure/regression_scope_test.go
  that assert the script and docs agree on scope, preventing silent drift.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: reconcile regression gate scope with documented full-suite policy

1 participant