Skip to content

Adopt the lifted JasperFx.Events ProjectionScenario - #5133

Merged
jeremydmiller merged 1 commit into
masterfrom
feat/5127-scenario-lift
Aug 3, 2026
Merged

Adopt the lifted JasperFx.Events ProjectionScenario#5133
jeremydmiller merged 1 commit into
masterfrom
feat/5127-scenario-lift

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Follow-up to #5127 / #5132. Consumes the cross-store lift in JasperFx/jasperfx#616.

Important

Draft: this will not go green until JasperFx.Events 2.38.0 is published. The Directory.Packages.props pin here is the intended published version — #616 is open, not merged. The branch was built and tested against a local pack of that branch; it needs re-verification against the real package before this leaves draft.

What changes

Marten's Events/TestSupport goes from seven files of harness to a single ~70-line subclass. Everything about how a scenario behaves — step queueing, batched commits, the #5126 trailing flush, action fail-fast, the re-execution guard, daemon lifecycle, Timeout — now lives on the shared ProjectionScenario<TOperations, TQuerySession> base type in JasperFx.Events.TestSupport.

What's left in Marten is only the store-specific seam: DeleteExistingDataAsync, HasAnyAsyncProjections, BuildDaemonAsync, OpenSession, SaveChangesAsync, EventsFor, and the object-id LoadDocumentAsync dispatch — the same switch MartenComplianceFixture already carries. Net −692 / +51 lines.

API impact

Small, and on top of the already-breaking #5132:

  • scenario.Execute(ct)scenario.ExecuteAsync(ct).
  • ProjectionScenarioException and ProjectionScenarioAssertionException move from Marten.Events.TestSupport to JasperFx.Events.TestSupport. Test code that catches either needs the new using.
  • DocumentShouldExist<T> / DocumentShouldNotExist<T> now take object ids on the base type instead of four typed overloads each. Existing typed call sites keep compiling — everything converts to object.

Everything else a user touches is unchanged from #5132.

Verification (against a local pack of #616)

Merge order

  1. Not possible to use Serializable transactions #616 merges and JasperFx.Events 2.38.0 publishes.
  2. Re-verify this branch against the real package, undraft.
  3. Consume the lifted JasperFx.Events ProjectionScenario polecat#404 then subclasses the same base type — no hand-ported overloads.

🤖 Generated with Claude Code

Consumes the cross-store lift in #616. Marten's
Events/TestSupport goes from seven files of harness to one ~70-line
subclass that only supplies the store-specific seam:
DeleteExistingDataAsync, HasAnyAsyncProjections, BuildDaemonAsync,
OpenSession, SaveChangesAsync, EventsFor, and the object-id
LoadDocumentAsync dispatch (the same switch MartenComplianceFixture
already carries).

All scripting and execution behavior -- step queueing, batched commits,
the marten#5126 trailing flush, action fail-fast, the re-execution guard,
daemon lifecycle, Timeout -- now lives on the shared base type. The
public API a user touches is unchanged from #5132 apart from
Execute -> ExecuteAsync, and the two exception types moving from
Marten.Events.TestSupport to JasperFx.Events.TestSupport.

DocumentShouldExist/DocumentShouldNotExist now take object ids on the
base type instead of four typed overloads each. Existing typed call
sites keep compiling.

BLOCKED: the JasperFx/JasperFx.Events 2.38.0 pin here is the *intended*
published version -- #616 is open, not merged or published. This
branch was built and tested against a local pack of that branch and must
be re-verified against the real package before merge.

net9.0: DaemonTests scenario suite 15/15, CoreTests exception convention
green, full Marten.slnx builds clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jeremydmiller
jeremydmiller marked this pull request as ready for review August 3, 2026 13:05
@jeremydmiller
jeremydmiller force-pushed the feat/5127-scenario-lift branch from 85fa79f to fddbe94 Compare August 3, 2026 13:05
@jeremydmiller

Copy link
Copy Markdown
Member Author

Rebased onto master now that JasperFx.Events 2.38.0 is published and #5135 has landed. The Directory.Packages.props pin edit dropped out as redundant — master already carries 2.38.0.

Re-verified against the published package rather than the local pack this was originally proven with: full Marten.slnx builds clean and the scenario suite is 15/15 on net9.0. Out of draft.

🤖 Generated with Claude Code

@jeremydmiller
jeremydmiller merged commit 5d5d5b3 into master Aug 3, 2026
10 checks passed
@jeremydmiller
jeremydmiller deleted the feat/5127-scenario-lift branch August 3, 2026 13:19
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