Document cross-tenant fixture limitation; delete completed plans#381
Merged
Document cross-tenant fixture limitation; delete completed plans#381
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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-contextuse_transactional_tests = falsewith truncation cleanup (RSpec + Minitest snippets)docs/designs/are the permanent reference; plan files are implementation scaffolds consumed by merged PRsdocs/plans/apartment-v4/overview.mdwith 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
🤖 Generated with Claude Code