Skip to content

refactor(storetest): split shared suite into per-domain sub-suites#56

Merged
jmgilman merged 1 commit into
masterfrom
session-034/storetest-split
May 26, 2026
Merged

refactor(storetest): split shared suite into per-domain sub-suites#56
jmgilman merged 1 commit into
masterfrom
session-034/storetest-split

Conversation

@jmgilman
Copy link
Copy Markdown
Contributor

Summary

  • Replaces the 1820-line single Run function (with //nolint:funlen,gocognit) in internal/storetest/storetest.go with a thin orchestrator that calls one named sub-suite per storage domain plus a cross-cutting context-cancellation sweep.
  • One file per domain: principals.go, roles.go, provisioning.go, identity.go (link/resolve/provision + concurrency), passkey.go, oidc.go, tokens.go, context.go. Shared factories move into fixtures.go with one-line godocs.
  • Public surface is byte-identical to master (go doc ./internal/storetest): still exactly func Run(...) and type Store interface{ ... }.
  • Leaf test names (e.g. create principal/creates user principal) are preserved so existing grep targets and CI logs keep matching.
  • Larger sub-suites carry a scoped //nolint:funlen (and gocognit where needed) with a clear rationale; the original mega-suite suppression on Run is removed.

This is PR A of a three-PR storage-package refactor pass; PR B and PR C touch store/memory and store/postgres respectively and both depend on this one landing first.

Test plan

  • go test ./... from repo root (incl. TestSharedStoreBehavior against memory)
  • moon run root:check --summary minimal (vet, lint, build, unit tests)
  • moon run root:integration (postgres Testcontainers suite)
  • git diff --check (no whitespace damage)
  • go doc ./internal/storetest matches master

🤖 Generated with Claude Code

Replace the 1820-line single Run function (carrying nolint:funlen,gocognit)
with a thin orchestrator that calls one named sub-suite per storage domain
plus a cross-cutting context-cancellation sweep. Adding a new domain now
means adding a sub-suite file and one call in Run, rather than scrolling
through one mega-function. Test names at the leaves are preserved so existing
grep targets and CI logs keep matching.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jmgilman jmgilman merged commit cdafcc6 into master May 26, 2026
2 checks passed
@jmgilman jmgilman deleted the session-034/storetest-split branch May 26, 2026 20:23
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.

1 participant