#4617 PR 3: migrate sharded partitioned tests + per_tenant_events_flag guard subset#4623
Merged
jeremydmiller merged 1 commit intoJun 3, 2026
Merged
Conversation
…g guard subset Completes the existing-test-file migration leg of #4617 by moving the last 3 files into the TenantPartitionedEventsTests project. ## Sharded migrations (15 tests across 2 files) New `Sharded/ShardedPartitionedFixture.cs` — clone of MultiTenancyTests' `ShardedTenancyFixture` with a distinct xUnit collection id (`"sharded-tenant-partitioned"` vs the original `"sharded-tenancy"`) so the two projects' collection definitions never get mistaken for each other in a shared run. The fixture provisions the 3 physical shard databases (`marten_shard_a/b/c`), drops the well-known per-test schemas, and exposes the per-shard connection strings — identical setup to the original. Helper `CleanMartenObjectsInPublicSchema` is public (vs the original's internal visibility) so tests can call it directly when they need to scrub a shard. Migrated files: - `Sharded/sharded_tenancy_per_tenant_events.cs` (10 tests) — the headline sharded per-tenant partitioning + #4598 sequence-provisioning surface. - `Sharded/sharded_eager_apply_per_tenant_events.cs` (1 test) — #4606 eager-apply + per-tenant partition-attach regression. Per-test isolation is preserved (each test still builds its own DocumentStore and wipes shard schemas in InitializeAsync — sharded tests have always been per-test-store; the fixture only provides the shard DBs). Hardcoded tenant names ("alpha", "bravo", "india", "echo") stay — they're safe under the fixture's DisableParallelization + per-test wipe pattern. ## Config-guard migration (4 tests in 1 file) `Config/per_tenant_events_flag_guards.cs` extracts the `per_tenant_events_flag` nested class from `CoreTests/StoreOptionsTests.cs` into the new project so every per-tenant-partitioning guard lives in one place alongside its companions (`schema_groundwork_for_partitioned_events`, etc.). Tests covered: `defaults_to_false`, `validate_throws_when_combined_with_rich_append_mode`, + `validate_succeeds_with_quick_modes` [Theory] over Quick + QuickWithServerTimestamps. The CoreTests slot keeps a one-line breadcrumb pointing to the new location. ## Verification | Suite | Result | |---|---| | `TenantPartitionedEventsTests` | **net9.0**: 55/55 (was 40 in PR #4622) — **net10.0**: 55/55 | | `CoreTests.StoreOptionsTests` | 27 passed / 1 skipped (unchanged after the 4 moved out — the per-tenant guards weren't part of the parent class's test count) | | `MultiTenancyTests` build | clean — no dangling refs to the 2 deleted sharded files | ## Migration leg complete With this PR, all 9 existing partitioned test files from MultiTenancyTests + the CoreTests config-guard subset are now consolidated in TenantPartitionedEventsTests. Subsequent PRs per the #4617 checklist will add the new test categories from sections 3-5 (DCB partitioned coverage, EventProjection, FlatTableProjection, MultiStream RollUpByTenant / AcrossTenants, MasterTableTenancy + SingleServerMultiTenancy gap pins, daemon-in-depth, regression families) plus the string-identity coverage of the optimistic-append feature shipped in #4621. Co-Authored-By: Claude Opus 4.7 (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.
Completes the existing-test-file migration leg of #4617 by moving the last 3 files into
TenantPartitionedEventsTests. With this PR, every existing partitioned test file fromMultiTenancyTests+ theCoreTestsconfig-guard subset is now consolidated in the new project.Sharded migrations (15 tests across 2 files)
New
Sharded/ShardedPartitionedFixture.cs— a clone ofMultiTenancyTests'sShardedTenancyFixturewith a distinct xUnit collection id (\"sharded-tenant-partitioned\"vs the original\"sharded-tenancy\") so the two projects' collection definitions never get mistaken for each other in a shared run. The fixture provisions the 3 physical shard databases (marten_shard_a/b/c), drops the well-known per-test schemas, and exposes the per-shard connection strings — identical setup to the original. HelperCleanMartenObjectsInPublicSchemais public (vs the original's internal visibility) so tests can call it directly when they need to scrub a shard.Sharded/sharded_tenancy_per_tenant_events.csIDynamicTenantSource<string>lifecycleSharded/sharded_eager_apply_per_tenant_events.csPer-test isolation is preserved (each test still builds its own
DocumentStoreand wipes shard schemas inInitializeAsync— sharded tests have always been per-test-store; the fixture only provides the shard DBs). Hardcoded tenant names (\"alpha\",\"bravo\",\"india\",\"echo\") stay — they're safe under the fixture'sDisableParallelization+ per-test wipe pattern.Config-guard migration (4 tests in 1 file)
Config/per_tenant_events_flag_guards.csextracts theper_tenant_events_flagnested class fromCoreTests/StoreOptionsTests.csinto the new project so every per-tenant-partitioning guard lives in one place alongside its companions (schema_groundwork_for_partitioned_events, etc.):defaults_to_falsevalidate_throws_when_combined_with_rich_append_modevalidate_succeeds_with_quick_modes[Theory]overQuick+QuickWithServerTimestampsThe
CoreTestsslot keeps a one-line breadcrumb pointing to the new location.Verification
TenantPartitionedEventsTests(full project)CoreTests.StoreOptionsTestsfiltered sweepMultiTenancyTestsbuildMigration leg complete
With this PR, all 9 existing partitioned test files from
MultiTenancyTests+ theCoreTestsconfig-guard subset are now consolidated inTenantPartitionedEventsTests. Subsequent PRs per the #4617 checklist will add the new test categories from sections 3-5 (DCB partitioned coverage, EventProjection, FlatTableProjection, MultiStreamRollUpByTenant/AcrossTenants, MasterTableTenancy + SingleServerMultiTenancy gap pins, daemon-in-depth, regression families) plus the string-identity coverage of the optimistic-append feature shipped in #4621.🤖 Generated with Claude Code