Skip to content

Document cross-tenant fixture limitation; delete completed plans#381

Merged
mnovelo merged 2 commits intomainfrom
man/docs-cleanup-test-guide
Apr 11, 2026
Merged

Document cross-tenant fixture limitation; delete completed plans#381
mnovelo merged 2 commits intomainfrom
man/docs-cleanup-test-guide

Conversation

@mnovelo
Copy link
Copy Markdown
Collaborator

@mnovelo mnovelo commented Apr 11, 2026

Summary

  • Add "Cross-Tenant Transactional Fixture Limitation" section to v4-test-fixtures-compatibility.md: explains why pool-per-tenant breaks transactional fixtures for cross-tenant specs, why pinned models (qualified table names) fix name resolution but not transaction visibility, and recommends per-context use_transactional_tests = false with truncation cleanup (RSpec + Minitest snippets)
  • Delete 5 completed plan files (elevators, migrations, railtie-test-infra, deferred-pin-tenant, test-fixtures-compatibility) — design docs in docs/designs/ are the permanent reference; plan files are implementation scaffolds consumed by merged PRs
  • Update docs/plans/apartment-v4/overview.md with post-alpha2 entries (Defer pin_tenant processing until class body closes #378-380)

Context

Investigation of v4 pool-per-tenant breaking transactional fixture isolation in CampusESP CI revealed this is an architectural constraint, not a bug to fix at the gem level. v4 intentionally uses separate physical connections per tenant; Rails' transactional fixtures assume a single shared connection. The correct fix is at the test strategy level: cross-tenant specs disable transactional tests and use truncation.

Alternatives rejected: test-mode SET search_path (re-introduces the mutation v4 eliminated), always routing pinned models through default pool (breaks #374's transactional integrity guarantee).

Test plan

  • No code changes — docs only
  • Verify design doc reads coherently with the new section

🤖 Generated with Claude Code

mnovelo and others added 2 commits April 11, 2026 13:58
…ted plans

Add testing guide to v4-test-fixtures-compatibility.md explaining why
pool-per-tenant breaks transactional fixtures for cross-tenant specs,
why pinned models don't fix transaction visibility, and the recommended
per-context use_transactional_tests = false strategy.

Delete completed plan files (elevators, migrations, railtie-test-infra,
deferred-pin-tenant, test-fixtures-compatibility) — design docs are the
permanent reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Trigger B step 5: describe post-#380 behavior (early return), note
  pre-#380 behavior parenthetically
- Scope section: clarify all strategies have cross-connection visibility
  constraints, not just PG schema
- Add DatabaseCleaner note to cleanup guidance
- Replace brittle line number reference with descriptive text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mnovelo mnovelo merged commit 38f1415 into main Apr 11, 2026
43 checks passed
@mnovelo mnovelo deleted the man/docs-cleanup-test-guide branch April 11, 2026 18:07
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