Skip to content

Migrate ValueTypeTests hand-rolled stores onto OneOffConfigurationsContext - #5105

Merged
jeremydmiller merged 1 commit into
masterfrom
chore/harness-valuetypetests
Aug 1, 2026
Merged

Migrate ValueTypeTests hand-rolled stores onto OneOffConfigurationsContext#5105
jeremydmiller merged 1 commit into
masterfrom
chore/harness-valuetypetests

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Phase-2 test-harness standardization, first non-event-sourcing hotspot (companion to #5104). Net −444 lines.

16 test classes across 13 ValueTypeTests files each hand-rolled a DocumentStore in the constructor, with three inconsistent disposal variantsIDisposable+IAsyncDisposable (the async path leaked the session), IAsyncDisposable alone, and IAsyncLifetime with per-test DeleteDocumentsByTypeAsync cleanup — and hand-numbered schema literals (strong_typed1..24, duplicated_value_type_field1/2, strong_typed_exists, strong_typed_fsharp).

All 16 classes now derive from OneOffConfigurationsContext:

  • per-class schema names replace the hand-numbered literals
  • the schema is dropped per test instance, so the IAsyncLifetime variants' per-test document cleanup is retired (each test now starts pristine)
  • disposal is owned by the base — no more session leaks on the async path
  • the three classes with real configuration (duplicated_value_type_field_operations ×2, the F# discriminated-union STJ setup) keep a constructor calling StoreOptions(...); the other 13 need no constructor at all

Untouched: registration.cs / applicability_of_identity_types.cs (pure unit tests, no store), the three classes already on OneOffConfigurationsContext, and the two BugIntegrationContext bug tests.

Verification

net9.0 local: full ValueTypeTests suite 340/340 (20s).

🤖 Generated with Claude Code

https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB

…ntext

Phase-2 harness standardization, non-ES hotspot: 16 test classes across 13
ValueTypeTests files each hand-rolled a DocumentStore in the constructor with
three inconsistent disposal variants (IDisposable+IAsyncDisposable that leaked
the session on the async path, IAsyncDisposable alone, and IAsyncLifetime with
per-test DeleteDocumentsByTypeAsync cleanup) and hand-numbered schema literals
(strong_typed1..24, duplicated_value_type_field1/2, strong_typed_exists,
strong_typed_fsharp).

All 16 classes now derive from OneOffConfigurationsContext: per-class schema
names, schema dropped per test instance (which also retires the IAsyncLifetime
variants' per-test document cleanup — the schema is now pristine per test),
and disposal owned by the base. The three classes with real configuration
(duplicated value-type field x2, F# discriminated unions' STJ setup) keep a
constructor calling StoreOptions; the other 13 need no constructor at all.

net9.0: ValueTypeTests 340/340.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB
@jeremydmiller
jeremydmiller merged commit 2c95698 into master Aug 1, 2026
10 checks passed
@jeremydmiller
jeremydmiller deleted the chore/harness-valuetypetests branch August 1, 2026 15:37
jeremydmiller added a commit that referenced this pull request Aug 1, 2026
…esses (#5106)

Phase-2 harness standardization, CoreTests hotspot (follows #5104/#5105).

Nine inline-host files move onto HostedStoreContext (newly Compile-linked
into CoreTests.csproj): Bugs/Bug_4185, Bugs/Bug_4187, Bugs/Bug_5039,
configuring_marten_with_async_extensions (the sample_registering_async_config
snippet line stays verbatim inside the configureServices lambda),
document_store_diagnostics_tests (8 doc_diag_* literals) and
document_store_usage_tests (6 doc_usage_* literals; literal-schema assertions
rewritten against SchemaName), lazy_ancillary_store_registration,
setting_solo_mode_in_test_support, and working_with_initial_data (deletes the
local MartenHost wrapper; ancillary stores get SchemaName-derived schemas).

Four files move onto / are cleaned up within OneOffConfigurationsContext:
request_count_tracking (also fixes its wrong-order hand-rolled Dispose),
migrate_from_guid_to_int_based_revisions (StoreOptions + SeparateStore over
the shared "migrations" literal), SessionOptionsTests (four leaked
custom-connection stores become tracked SeparateStore calls), and a stray
undisposed store in EventTracingConnectionLifetimeTests gets await using.

Deliberately untouched, by classification: the five Partitioning/* files
(disciplined ProcessId-suffixed schemas plus a second partition-management
schema the OneOff base cannot express - same call as the TPE multi-node
files); disposal-semantics tests (Bug_4874 trio, Bug_4915); DI-registration
assertion tests (bootstrapping_with_service_collection_extensions,
daemon_mode_externally_managed, jasper_fx_mechanics); doc-sample files
(BootstrappingExamples, Examples/*, Bug_962); and pure options unit tests
(StoreOptionsTests, row_level_security_unit_tests, applying_metrics,
extended_progression_gate, constructing_projection_coordinator...).

net9.0: CoreTests 519 passed / 0 failed (1 pre-existing skip).


Claude-Session: https://claude.ai/code/session_01U99pVx6kXwiGmaBUGLv7jB

Co-authored-by: Claude Fable 5 <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.

1 participant