From f3e874f2c5f69dc548e44ba90e08fdd4c74d4c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giuseppe=20Patan=C3=A8?= Date: Tue, 29 Aug 2023 07:06:04 +0200 Subject: [PATCH] Marten ProviderUpdate and Persistence provider test (#2031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Update Marten package version to 6.0.2 - Updated the Marten package version from 4.3.1 to 6.0.2 in the project file. - Changed the access modifier of the `Event` and `Snapshot` classes from internal to public in the `Proto.Persistence.Marten` namespace. - Replaced calls to `_store.OpenSession()` with `_store.IdentitySession()` in the `MartenProvider` class for consistency. - Added new test cases for different providers (InMemory and Marten) in the `ExamplePersistentActorTests` class: - EventsAreSavedToPersistence - SnapshotsAreSavedToPersistence - EventsCanBeDeleted - SnapshotsCanBeDeleted - GivenEventsOnly_StateIsRestoredFromEvents - GivenASnapshotOnly_StateIsRestoredFromTheSnapshot - GivenEventsThenASnapshot_StateShouldBeRestoredFromTheSnapshot - GivenASnapshotAndSubsequentEvents_StateShouldBeRestoredFromSnapshotAndSubsequentEvents - GivenMultipleSnapshots_StateIsRestoredFromMostRecentSnapshot * Refactor tests to use Sqlite provider * Add support for additional persistence providers This commit adds support for the following persistence providers: - Couchbase - DynamoDB - MongoDB - RavenDB - SQL Server It also includes changes to the ExamplePersistentActorTests class to test the functionality of these new providers. * removed providers --------- Co-authored-by: Giuseppe Patanè --- src/Proto.Persistence.Marten/Event.cs | 2 +- .../MartenProvider.cs | 12 +- .../Proto.Persistence.Marten.csproj | 2 +- src/Proto.Persistence.Marten/Snapshot.cs | 2 +- .../ExamplePersistentActorTests.cs | 309 ++++++++++++++---- .../PersistenceWithSnapshotStrategiesTests.cs | 2 + .../Proto.Persistence.Tests.csproj | 16 +- 7 files changed, 264 insertions(+), 81 deletions(-) diff --git a/src/Proto.Persistence.Marten/Event.cs b/src/Proto.Persistence.Marten/Event.cs index 4f97488ed1..e3f29f09a2 100644 --- a/src/Proto.Persistence.Marten/Event.cs +++ b/src/Proto.Persistence.Marten/Event.cs @@ -1,6 +1,6 @@ namespace Proto.Persistence.Marten; -internal class Event +public class Event { public Event(string actorName, long index, object data) { diff --git a/src/Proto.Persistence.Marten/MartenProvider.cs b/src/Proto.Persistence.Marten/MartenProvider.cs index 48cefc5b3b..f455465b5b 100644 --- a/src/Proto.Persistence.Marten/MartenProvider.cs +++ b/src/Proto.Persistence.Marten/MartenProvider.cs @@ -16,7 +16,7 @@ public MartenProvider(IDocumentStore store) public async Task GetEventsAsync(string actorName, long indexStart, long indexEnd, Action callback) { - var session = _store.OpenSession(); + var session = _store.IdentitySession(); await using var _ = session.ConfigureAwait(false); var events = await session.Query() @@ -35,7 +35,7 @@ public async Task GetEventsAsync(string actorName, long indexStart, long i public async Task<(object Snapshot, long Index)> GetSnapshotAsync(string actorName) { - var session = _store.OpenSession(); + var session = _store.IdentitySession(); await using var _ = session.ConfigureAwait(false); var snapshot = await session.Query() @@ -48,7 +48,7 @@ public async Task GetEventsAsync(string actorName, long indexStart, long i public async Task PersistEventAsync(string actorName, long index, object @event) { - using var session = _store.OpenSession(); + var session = _store.IdentitySession(); session.Store(new Event(actorName, index, @event)); @@ -59,7 +59,7 @@ public async Task PersistEventAsync(string actorName, long index, object @ public async Task PersistSnapshotAsync(string actorName, long index, object snapshot) { - using var session = _store.OpenSession(); + var session = _store.IdentitySession(); session.Store(new Snapshot(actorName, index, snapshot)); @@ -68,7 +68,7 @@ public async Task PersistSnapshotAsync(string actorName, long index, object snap public async Task DeleteEventsAsync(string actorName, long inclusiveToIndex) { - using var session = _store.OpenSession(); + var session = _store.IdentitySession(); session.DeleteWhere(x => x.ActorName == actorName && @@ -80,7 +80,7 @@ public async Task DeleteEventsAsync(string actorName, long inclusiveToIndex) public async Task DeleteSnapshotsAsync(string actorName, long inclusiveToIndex) { - using var session = _store.OpenSession(); + var session = _store.IdentitySession(); session.DeleteWhere(x => x.ActorName == actorName && diff --git a/src/Proto.Persistence.Marten/Proto.Persistence.Marten.csproj b/src/Proto.Persistence.Marten/Proto.Persistence.Marten.csproj index cceb81d9c5..152a9d9fb3 100644 --- a/src/Proto.Persistence.Marten/Proto.Persistence.Marten.csproj +++ b/src/Proto.Persistence.Marten/Proto.Persistence.Marten.csproj @@ -3,7 +3,7 @@ net6.0;net7.0 - + diff --git a/src/Proto.Persistence.Marten/Snapshot.cs b/src/Proto.Persistence.Marten/Snapshot.cs index a87c3f925b..7301ca6e36 100644 --- a/src/Proto.Persistence.Marten/Snapshot.cs +++ b/src/Proto.Persistence.Marten/Snapshot.cs @@ -1,6 +1,6 @@ namespace Proto.Persistence.Marten; -internal class Snapshot +public class Snapshot { public Snapshot(string actorName, long index, object data) { diff --git a/tests/Proto.Persistence.Tests/ExamplePersistentActorTests.cs b/tests/Proto.Persistence.Tests/ExamplePersistentActorTests.cs index 48b92cb4ac..6b81932aa4 100644 --- a/tests/Proto.Persistence.Tests/ExamplePersistentActorTests.cs +++ b/tests/Proto.Persistence.Tests/ExamplePersistentActorTests.cs @@ -1,22 +1,85 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; +using Marten; +using Microsoft.Data.Sqlite; +using MongoDB.Bson; +using MongoDB.Bson.Serialization; +using MongoDB.Bson.Serialization.Serializers; +using MongoDB.Driver; +using Proto.Persistence.Marten; +using Proto.Persistence.MongoDB; +using Proto.Persistence.Sqlite; +using Proto.Persistence.SqlServer; using Proto.TestFixtures; +using Testcontainers.MongoDb; +using Testcontainers.MsSql; +using Testcontainers.PostgreSql; using Xunit; namespace Proto.Persistence.Tests; -public class ExamplePersistentActorTests + + +public class ExamplePersistentActorTests: IAsyncLifetime { private const int InitialState = 1; - - [Fact] - public async Task EventsAreSavedToPersistence() + private readonly PostgreSqlContainer _postgreSqlContainer = new PostgreSqlBuilder() + .WithDatabase("IntegrationTests") + .WithUsername("postgres") + .WithPassword("root") + .WithCommand(new[] { "-c", "log_statement=all" }) + .Build(); + + readonly MsSqlContainer _msSqlContainer = new MsSqlBuilder() + .Build(); + readonly MongoDbContainer _mongoDbContainer = new MongoDbBuilder() + .Build(); + + private IProvider GetProvider(TestProvider providerType) + { + switch (providerType) + { + case TestProvider.InMemory: + return new InMemoryProvider(); + case TestProvider.Marten: + return new MartenProvider(DocumentStore.For(_postgreSqlContainer.GetConnectionString())); + case TestProvider.Sqlite: + return new SqliteProvider( + new SqliteConnectionStringBuilder($"Data Source=file:{Guid.NewGuid()}?mode=memory")); + case TestProvider.SqlServer: + return new SqlServerProvider(_msSqlContainer.GetConnectionString(), true); + case TestProvider.MongoDb: + try + { + ObjectSerializer objectSerializer = new ObjectSerializer(type => + ObjectSerializer.DefaultAllowedTypes(type) || type.FullName.StartsWith("Proto.Persistence.Tests")); + + BsonSerializer.RegisterSerializer(objectSerializer); + } + catch (BsonSerializationException e) + { + } + return new MongoDBProvider(new MongoClient(_mongoDbContainer.GetConnectionString()) + .GetDatabase("Test")); + default: + throw new ArgumentOutOfRangeException(nameof(providerType), providerType, null); + } + } + + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + + public async Task EventsAreSavedToPersistence(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, _, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, _, actorId, providerState) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); await providerState @@ -28,27 +91,38 @@ await providerState ); } - [Fact] - public async Task SnapshotsAreSavedToPersistence() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task SnapshotsAreSavedToPersistence(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, _, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, _, actorId, providerState) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 10 }); context.Send(pid, new RequestSnapshot()); var (snapshot, _) = await providerState.GetSnapshotAsync(actorId); var snapshotState = snapshot as State; - Assert.Equal(10, snapshotState.Value); + Assert.NotNull(snapshotState?.Value); + Assert.Equal(10, snapshotState?.Value); } - [Fact] - public async Task EventsCanBeDeleted() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task EventsCanBeDeleted(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, _, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, _, actorId, providerState) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 10 }); await providerState.DeleteEventsAsync(actorId, 1); var events = new List(); @@ -57,13 +131,18 @@ public async Task EventsCanBeDeleted() Assert.Empty(events); } - [Fact] - public async Task SnapshotsCanBeDeleted() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task SnapshotsCanBeDeleted(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, _, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, _, actorId, providerState) = CreateTestActor(context, provider); context.Send(pid, new Multiply { Amount = 10 }); context.Send(pid, new RequestSnapshot()); await providerState.DeleteSnapshotsAsync(actorId, 1); @@ -71,38 +150,54 @@ public async Task SnapshotsCanBeDeleted() Assert.Null(snapshot); } - [Fact] - public async Task GivenEventsOnly_StateIsRestoredFromEvents() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task GivenEventsOnly_StateIsRestoredFromEvents(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, _, _) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, _, _) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new Multiply { Amount = 2 }); var state = await RestartActorAndGetState(pid, props, context); Assert.Equal(InitialState * 2 * 2, state); } - [Fact] - public async Task GivenASnapshotOnly_StateIsRestoredFromTheSnapshot() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task GivenASnapshotOnly_StateIsRestoredFromTheSnapshot(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, actorId, providerState) = CreateTestActor(context,provider); await providerState.PersistSnapshotAsync(actorId, 0, new State { Value = 10 }); var state = await RestartActorAndGetState(pid, props, context); Assert.Equal(10, state); } - [Fact] - public async Task GivenEventsThenASnapshot_StateShouldBeRestoredFromTheSnapshot() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + + public async Task GivenEventsThenASnapshot_StateShouldBeRestoredFromTheSnapshot(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, _, _) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, _, _) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new RequestSnapshot()); @@ -111,13 +206,18 @@ public async Task GivenEventsThenASnapshot_StateShouldBeRestoredFromTheSnapshot( Assert.Equal(expectedState, state); } - [Fact] - public async Task GivenASnapshotAndSubsequentEvents_StateShouldBeRestoredFromSnapshotAndSubsequentEvents() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task GivenASnapshotAndSubsequentEvents_StateShouldBeRestoredFromSnapshotAndSubsequentEvents( TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, _, _) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, _, _) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new RequestSnapshot()); @@ -128,13 +228,18 @@ public async Task GivenASnapshotAndSubsequentEvents_StateShouldBeRestoredFromSna Assert.Equal(expectedState, state); } - [Fact] - public async Task GivenMultipleSnapshots_StateIsRestoredFromMostRecentSnapshot() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task GivenMultipleSnapshots_StateIsRestoredFromMostRecentSnapshot(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, actorId, providerState) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new RequestSnapshot()); @@ -145,13 +250,18 @@ public async Task GivenMultipleSnapshots_StateIsRestoredFromMostRecentSnapshot() Assert.Equal(InitialState * 2 * 4, state); } - [Fact] - public async Task GivenMultipleSnapshots_DeleteSnapshotObeysIndex() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task GivenMultipleSnapshots_DeleteSnapshotObeysIndex(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, actorId, providerState) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new RequestSnapshot()); @@ -164,13 +274,18 @@ public async Task GivenMultipleSnapshots_DeleteSnapshotObeysIndex() Assert.Equal(expectedState, state); } - [Fact] - public async Task GivenASnapshotAndEvents_WhenSnapshotDeleted_StateShouldBeRestoredFromEvents() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task GivenASnapshotAndEvents_WhenSnapshotDeleted_StateShouldBeRestoredFromEvents(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, actorId, providerState) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new Multiply { Amount = 2 }); @@ -183,13 +298,18 @@ public async Task GivenASnapshotAndEvents_WhenSnapshotDeleted_StateShouldBeResto Assert.Equal(InitialState * 2 * 2 * 4 * 8, state); } - [Fact] - public async Task Index_IncrementsOnEventsSaved() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task Index_IncrementsOnEventsSaved(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, _, _, _) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, _, _, _) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); var index = await context.RequestAsync(pid, new GetIndex(), TimeSpan.FromSeconds(1)); @@ -199,13 +319,18 @@ public async Task Index_IncrementsOnEventsSaved() Assert.Equal(1, index); } - [Fact] - public async Task Index_IsIncrementedByTakingASnapshot() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task Index_IsIncrementedByTakingASnapshot(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, _, _, _) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, _, _, _) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new RequestSnapshot()); @@ -214,13 +339,18 @@ public async Task Index_IsIncrementedByTakingASnapshot() Assert.Equal(2, index); } - [Fact] - public async Task Index_IsCorrectAfterRecovery() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task Index_IsCorrectAfterRecovery(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, props, _, _) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, props, _, _) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new Multiply { Amount = 4 }); @@ -233,13 +363,18 @@ public async Task Index_IsCorrectAfterRecovery() Assert.Equal(InitialState * 2 * 4, state); } - [Fact] - public async Task GivenEvents_CanReplayFromStartIndexToEndIndex() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task GivenEvents_CanReplayFromStartIndexToEndIndex(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; - - var (pid, _, actorId, providerState) = CreateTestActor(context); + var provider = GetProvider(testProvider); + var (pid, _, actorId, providerState) = CreateTestActor(context,provider); context.Send(pid, new Multiply { Amount = 2 }); context.Send(pid, new Multiply { Amount = 2 }); @@ -252,15 +387,20 @@ public async Task GivenEvents_CanReplayFromStartIndexToEndIndex() Assert.Equal(4, ((Multiplied)messages[1]).Amount); } - [Fact] - public async Task CanUseSeparateStores() + [Theory] + [InlineData(TestProvider.InMemory)] + [InlineData(TestProvider.Sqlite)] + [InlineData(TestProvider.Marten)] + [InlineData(TestProvider.SqlServer)] + [InlineData(TestProvider.MongoDb)] + public async Task CanUseSeparateStores(TestProvider testProvider) { await using var system = new ActorSystem(); var context = system.Root; var actorId = Guid.NewGuid().ToString(); - var eventStore = new InMemoryProvider(); - var snapshotStore = new InMemoryProvider(); + var eventStore = GetProvider(testProvider); + var snapshotStore = GetProvider(testProvider); var props = Props.FromProducer(() => new ExamplePersistentActor(eventStore, snapshotStore, actorId)) .WithMailbox(() => new TestMailbox()); @@ -276,18 +416,18 @@ public async Task CanUseSeparateStores() Assert.Empty(snapshotStoreMessages); } - private (PID pid, Props props, string actorId, IProvider provider) CreateTestActor(IRootContext context) + private (PID pid, Props props, string actorId, IProvider provider) CreateTestActor(IRootContext context,IProvider provider) { var actorId = Guid.NewGuid().ToString(); - var inMemoryProvider = new InMemoryProvider(); + var props = Props - .FromProducer(() => new ExamplePersistentActor(inMemoryProvider, inMemoryProvider, actorId)) + .FromProducer(() => new ExamplePersistentActor(provider, provider, actorId)) .WithMailbox(() => new TestMailbox()); var pid = context.Spawn(props); - return (pid, props, actorId, inMemoryProvider); + return (pid, props, actorId, provider); } private async Task RestartActorAndGetState(PID pid, Props props, IRootContext context) @@ -297,13 +437,40 @@ private async Task RestartActorAndGetState(PID pid, Props props, IRootConte return await context.RequestAsync(pid, new GetState(), TimeSpan.FromMilliseconds(500)); } + + + public async Task InitializeAsync() + { + await _postgreSqlContainer.StartAsync(); + await _msSqlContainer.StartAsync(); + await _mongoDbContainer.StartAsync(); + } + + public async Task DisposeAsync() + { + await _postgreSqlContainer.StopAsync(); + await _msSqlContainer.StopAsync(); + await _mongoDbContainer.StopAsync(); + } } + internal class State { public int Value { get; set; } } +public enum TestProvider +{ + InMemory=1, + Couchbase=2, + Marten=3, + MongoDb=4, + RavenDb=5, + Sqlite=6, + SqlServer=7, + DynamoDb +} internal class GetState { } diff --git a/tests/Proto.Persistence.Tests/PersistenceWithSnapshotStrategiesTests.cs b/tests/Proto.Persistence.Tests/PersistenceWithSnapshotStrategiesTests.cs index 5c643dd01a..bc37bd436f 100644 --- a/tests/Proto.Persistence.Tests/PersistenceWithSnapshotStrategiesTests.cs +++ b/tests/Proto.Persistence.Tests/PersistenceWithSnapshotStrategiesTests.cs @@ -1,5 +1,7 @@ using System; using System.Threading.Tasks; +using Marten; +using Proto.Persistence.Marten; using Proto.Persistence.SnapshotStrategies; using Xunit; diff --git a/tests/Proto.Persistence.Tests/Proto.Persistence.Tests.csproj b/tests/Proto.Persistence.Tests/Proto.Persistence.Tests.csproj index 3d24ab5832..31ad687f46 100644 --- a/tests/Proto.Persistence.Tests/Proto.Persistence.Tests.csproj +++ b/tests/Proto.Persistence.Tests/Proto.Persistence.Tests.csproj @@ -4,9 +4,23 @@ net6.0;net7.0 - + + + + + + + + + + + + + + +