Bug in subinterface query - #607
Merged
Merged
Conversation
Member
|
@lngr Got it, and everything passes just fine. Code looks good and thank you for doing this. I did add another UT that just exercised the async path from your test. This will be in 1.2. |
Contributor
Author
|
@jeremydmiller lightning fast, as usual :) |
jeremydmiller
added a commit
that referenced
this pull request
Aug 2, 2026
JasperFx.Events.ComplianceTests shipped in the 2.37.1 line (#607), so the local prerelease pin used during development is replaced by the real version, and the rest of the JasperFx packages move with it to keep the dependency graph on one line. EventSourcingTests net9.0 against the published packages: 1613 passed, 0 failed, 7 skipped.
jeremydmiller
added a commit
that referenced
this pull request
Aug 2, 2026
…5116) (#5122) * Cross-store event sourcing compliance library, first cut (#5111, #5112, #5113) Phase 3 of the test harness standardization program (#5119, epic #5110). Lifts behavioral event sourcing tests out of Marten's own test project and into suites written once against a store-neutral seam, so Marten, Polecat and the planned Sqlite minimal store assert the same behavior instead of hand-mirroring each other's files. P3.1a -- the seam (src/Marten.Testing/Compliance/, namespace JasperFx.Events.ComplianceTests so extraction to the source-only package is a file move): - EventStoreComplianceFixture<TOperations, TQuerySession> mirroring JasperFx's own IEventStore<,> closure. Marten closes it <IDocumentOperations, IQuerySession>; Polecat will close it <IDocumentSession, IQuerySession>. Everything portable flows through the shared JasperFx surfaces; the fixture only absorbs what no shared interface declares -- store construction, session acquisition, SaveChangesAsync, document load-back, batched DCB queries, daemon plumbing and teardown. - ComplianceStoreConfig + IComplianceStoreRegistrar: store-neutral config replayed through recorded generic closures, so nothing here needs reflection or InternalsVisibleTo. - IComplianceBatch for the batched-DCB accessor divergence (batch.Events.EventsExist vs batch.EventsExist) until #5115 lands. - EventStoreComplianceSuite<TFixture, TOperations, TQuerySession> owning the fixture lifecycle, so enrolling a suite is a one-line empty subclass. - MartenComplianceFixture, Marten's ~120-line implementation. P3.1b/P3.1c -- four suites (42 tests) and Marten's enrollment: SelfAggregatingEvolveCompliance, DcbTagQueryAndConsistencyCompliance, AssignTagWhereCompliance, AsyncDaemonCompliance. Strongest assertion wins where the Marten and Polecat copies had drifted: - Inline snapshot cases assert the *persisted* document through LoadDocumentAsync. The Polecat mirror read back via AggregateStreamAsync, so it would have passed with a broken inline projection. - assign_tag_where_by_stream_id keeps Marten's e.StreamId == stream1 assertion rather than Polecat's weakened Data-type check. - Adopts two tests Marten never had, both from the Polecat side and both green here on day one: can_query_events_across_distinct_tag_types_with_or (the OR-across-distinct-tag-types INNER JOIN regression guard) and fetch_for_writing_appends_to_existing_tag_derived_stream_without_collision. Retirements: self_aggregating_evolve_method.cs and assign_tag_where_tests.cs are gone; dcb_tag_query_and_consistency_tests.cs is reduced to dcb_documentation_samples.cs, which keeps the eleven sample_marten_dcb_* snippet blocks docs/events/dcb.md pulls from plus the tag/event/aggregate types the HStore-specific fixtures share. Doc snippets stay repo-owned deliberately: after extraction the suite sources no longer live in this repo. EventSourcingTests net9.0: 1613 passed, 0 failed, 7 skipped. * Consume the compliance suites from JasperFx.Events.ComplianceTests (#5116) Second half of the extraction: the seam and the four suites now live in the jasperfx repo and arrive here as a source-only NuGet package, so Marten's copy under src/Marten.Testing/Compliance is deleted. What stays Marten-side is exactly what should: MartenComplianceFixture (the concrete seam implementation), the ComplianceQuerySession global alias binding the shared aggregates' EvolveAsync parameter to Marten's IQuerySession, and the empty enrollment subclasses in EventSourcingTests/Compliance. Both Marten.Testing and EventSourcingTests reference the package, because the harness assembly compiles MartenComplianceFixture and the test assembly needs the suites compiled in it for the aggregate source generator to bind Marten's session types. Pinned to a locally packed 2.37.0-compliance.2 for now; this moves to the published version when the package ships. EventSourcingTests net9.0 compliance suites: 42 passed, 0 failed. * Pin to the published JasperFx 2.37.1 JasperFx.Events.ComplianceTests shipped in the 2.37.1 line (#607), so the local prerelease pin used during development is replaced by the real version, and the rest of the JasperFx packages move with it to keep the dependency graph on one line. EventSourcingTests net9.0 against the published packages: 1613 passed, 0 failed, 7 skipped.
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.
If an
IPapaSmurfis queried,SubClassDocumentStoragewould try to deserialize to objects of typeIPapaSmurfinstead of the actual types.This bug was not triggered by the ST test case in the documentation because
.Count()does not actually instantiate the classes.The attached commits borrows the type resolving from
HierarchicalResolverby delegating toSubClassMapping. (I've seen the TODOs inSubClassDocumentStorage.csbut that's a larger architectural change that's currently beyond my abilities in the Marten codebase :) )Note: A plethora of tests fails on my local machine mainly due to (appearently) broken PLV8 extension on my dev machine. I could therefore not reliably confirm that the change breaks no other tests.