Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

11 changes: 3 additions & 8 deletions src/DaemonTests/Bugs/Bug_4428_rich_storage_side_effect_events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ namespace DaemonTests.Bugs;
/// <summary>
/// Regression for jasperfx/marten#4428.
///
/// When <c>StoreOptions.Events.UseClosedShapeStorage = true</c> and
/// <c>AppendMode = EventAppendMode.Rich</c>, the async-projection
/// Under <c>AppendMode = EventAppendMode.Rich</c>, the async-projection
/// side-effect replay path (JasperFx.Events <c>EventSlice.BuildOperations</c>
/// → <c>IProjectionBatch.QuickAppendEventWithVersion</c> →
/// Marten <c>ProjectionBatch.QuickAppendEventWithVersion</c> →
Expand All @@ -27,8 +26,8 @@ namespace DaemonTests.Bugs;
/// <c>NotImplementedException</c>. The closed-shape Rich implementation was
/// stubbed out and the assumption "the Rich appender only calls AppendEvent"
/// missed the daemon's side-effect replay path. This test asserts the
/// raised side-effect event lands in <c>mt_events</c> when running the rebuild
/// under <c>UseClosedShapeStorage = true</c> + Rich.
/// raised side-effect event lands in <c>mt_events</c> when running a Rich-mode
/// rebuild.
/// </summary>
public class Bug_4428_rich_storage_side_effect_events: OneOffConfigurationsContext
{
Expand All @@ -37,10 +36,6 @@ public async Task raised_side_effect_event_persists_under_closed_shape_rich()
{
StoreOptions(opts =>
{
// Force the closed-shape Rich path explicitly so the test reproduces
// #4428 regardless of the suite-wide env flag (which only affects
// UseClosedShapeStorage, not AppendMode).
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Rich;
opts.Projections.Add<Bug4428CounterProjection>(ProjectionLifecycle.Async);
});
Expand Down
11 changes: 6 additions & 5 deletions src/EventSourcingTests/Bugs/Bug_4411_closed_shape_read_side.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ namespace EventSourcingTests.Bugs;
/// </summary>
/// <remarks>
/// <para>
/// We can't yet flip <c>UseClosedShapeStorage</c> on end-to-end because
/// the closed-shape write path is still stubbed (#4413 / #4414). So the
/// test uses the codegen path to <i>append</i> events, then constructs a
/// <see cref="ClosedShapeEventDocumentStorage"/> directly and runs the same
/// select-from-mt_events query against it, comparing the resolved
/// Originally written before the closed-shape write path was wired
/// (when only the read side could be exercised), the test still pins
/// the read-side adapter behavior: it uses the standard append path to
/// insert events, then constructs a
/// <see cref="ClosedShapeEventDocumentStorage"/> directly and runs the
/// same select-from-mt_events query against it, comparing the resolved
/// <c>IEvent</c>s field-by-field.
/// </para>
/// </remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ namespace EventSourcingTests.Bugs;

/// <summary>
/// End-to-end smoke test for the closed-shape Rich-mode write path
/// (#4412 + #4413): flips <c>UseClosedShapeStorage = true</c>, sets
/// <c>AppendMode = Rich</c> (the closed-shape adapter currently only wires
/// the Rich path's write operations — Quick / QuickWithServerTimestamps
/// land in #4414 / #4415), and exercises:
/// (#4412 + #4413): sets <c>AppendMode = Rich</c> and exercises:
/// </summary>
/// <list type="number">
/// <item><see cref="ClosedShapeEventDocumentStorage.AppendEvent"/> via
Expand All @@ -35,7 +32,6 @@ public async Task start_stream_then_append_then_read_back_round_trip_guid_identi
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Rich;
});

Expand Down Expand Up @@ -101,7 +97,6 @@ public async Task start_stream_then_append_then_read_back_round_trip_string_iden
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Rich;
opts.Events.StreamIdentity = StreamIdentity.AsString;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public async Task quick_round_trip_guid_identity()
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Quick;
});

Expand Down Expand Up @@ -72,7 +71,6 @@ public async Task quick_round_trip_string_identity()
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Quick;
opts.Events.StreamIdentity = StreamIdentity.AsString;
});
Expand Down Expand Up @@ -113,7 +111,6 @@ public async Task quick_round_trip_with_scalar_metadata()
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Quick;
opts.Events.MetadataConfig.CausationIdEnabled = true;
opts.Events.MetadataConfig.CorrelationIdEnabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public async Task quick_with_server_timestamps_round_trip_guid_identity()
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
// AppendMode defaults to QuickWithServerTimestamps in v9, but
// be explicit here to pin the test against the right path.
opts.Events.AppendMode = EventAppendMode.QuickWithServerTimestamps;
Expand Down Expand Up @@ -80,7 +79,6 @@ public async Task quick_with_server_timestamps_default_v9_config_works()
// make no other config tweaks. This is the headline "drop-in" path.
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
});

var streamId = Guid.NewGuid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public async Task scalar_metadata_binders_round_trip_under_closed_shape_storage(
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Rich;
opts.Events.MetadataConfig.CausationIdEnabled = true;
opts.Events.MetadataConfig.CorrelationIdEnabled = true;
Expand Down Expand Up @@ -76,7 +75,6 @@ public async Task headers_round_trip_under_closed_shape_storage()
// #4416 part 2).
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Rich;
opts.Events.MetadataConfig.HeadersEnabled = true;
});
Expand Down Expand Up @@ -113,7 +111,6 @@ public async Task event_skipping_flag_does_not_break_rich_closed_shape_path()
// adapter must NOT fail the descriptor build.
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Rich;
opts.Events.EnableEventSkippingInProjectionsOrSubscriptions = true;
});
Expand All @@ -139,7 +136,6 @@ public async Task all_metadata_binders_together_round_trip()
// binder wired in #4416 part 1 + part 2.
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Rich;
opts.Events.MetadataConfig.CausationIdEnabled = true;
opts.Events.MetadataConfig.CorrelationIdEnabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public async Task hstore_tags_round_trip_under_closed_shape_flag()
{
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;

opts.Events.AddEventType<StudentEnrolled>();
opts.Events.AddEventType<AssignmentSubmitted>();
Expand Down Expand Up @@ -101,7 +100,6 @@ public async Task hstore_tags_round_trip_with_quick_append_mode()
// code paths.)
StoreOptions(opts =>
{
opts.Events.UseClosedShapeStorage = true;
opts.Events.AppendMode = EventAppendMode.Quick;

opts.Events.AddEventType<StudentEnrolled>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using JasperFx.Events;
using Marten;
using Marten.Events;
using Marten.Events.CodeGeneration;
using Marten.EventStorage;
using Marten.Events.Operations;
using Marten.Exceptions;
using Marten.Internal;
Expand Down Expand Up @@ -57,7 +57,7 @@ public async Task can_fetch_stream_async(TestCase @case)
await @case.StartNewStream();
await using var query = @case.Store.QuerySession();

var builder = EventDocumentStorageGenerator.GenerateStorage(@case.Store.Options);
var builder = new ClosedShapeEventDocumentStorage(@case.Store.Options);
var handler = builder.QueryForStream(@case.ToEventStream());

var state = await query.As<QuerySession>().ExecuteHandlerAsync(handler, CancellationToken.None);
Expand All @@ -73,7 +73,7 @@ public async Task can_insert_a_new_stream(TestCase @case)
@case.StartNewStream();

var stream = @case.CreateNewStream();
var builder = EventDocumentStorageGenerator.GenerateStorage(@case.Store.Options);
var builder = new ClosedShapeEventDocumentStorage(@case.Store.Options);
var op = builder.InsertStream(stream);

await using var session = @case.Store.LightweightSession();
Expand All @@ -92,7 +92,7 @@ public async Task can_update_the_version_of_an_existing_stream_sad_path(TestCase
stream.ExpectedVersionOnServer = 3; // it's actually 4, so this should fail
stream.Version = 10;

var builder = EventDocumentStorageGenerator.GenerateStorage(@case.Store.Options);
var builder = new ClosedShapeEventDocumentStorage(@case.Store.Options);
var op = builder.UpdateStreamVersion(stream);

await using var session = @case.Store.LightweightSession();
Expand Down
Loading
Loading