From aab44ef80fa94a9230561543d6157e5419181cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20Nor=C3=B0fj=C3=B6r=C3=B0?= Date: Sun, 11 Jun 2023 19:46:53 -0400 Subject: [PATCH] chore: upgrade FsCheck (#397) --- .../Store/Domain.Tests/Domain.Tests.fsproj | 2 +- samples/Store/Domain.Tests/Infrastructure.fs | 5 +++- samples/Store/Integration/CartIntegration.fs | 10 ++++---- .../ContactPreferencesIntegration.fs | 12 +++++----- .../Store/Integration/FavoritesIntegration.fs | 10 ++++---- samples/Store/Integration/Infrastructure.fs | 5 +++- samples/Store/Integration/Integration.fsproj | 2 +- samples/Store/Integration/LogIntegration.fs | 4 ++-- .../AccessStrategies.fs | 4 ++-- .../CosmosCoreIntegration.fs | 24 +++++++++---------- .../CosmosFixturesInfrastructure.fs | 5 +++- .../DocumentStoreIntegration.fs | 16 ++++++------- .../Equinox.CosmosStore.Integration.fsproj | 2 +- .../Equinox.DynamoStore.Integration.fsproj | 2 +- .../Equinox.EventStore.Integration.fsproj | 2 +- .../Equinox.EventStoreDb.Integration.fsproj | 2 +- .../Infrastructure.fs | 6 ++++- .../StoreIntegration.fs | 18 +++++++------- .../Equinox.MessageDb.Integration.fsproj | 2 +- ...ox.SqlStreamStore.MsSql.Integration.fsproj | 2 +- ...ox.SqlStreamStore.MySql.Integration.fsproj | 2 +- ...SqlStreamStore.Postgres.Integration.fsproj | 2 +- 22 files changed, 76 insertions(+), 63 deletions(-) diff --git a/samples/Store/Domain.Tests/Domain.Tests.fsproj b/samples/Store/Domain.Tests/Domain.Tests.fsproj index 8d023d58b..2dee0241b 100644 --- a/samples/Store/Domain.Tests/Domain.Tests.fsproj +++ b/samples/Store/Domain.Tests/Domain.Tests.fsproj @@ -17,7 +17,7 @@ - + diff --git a/samples/Store/Domain.Tests/Infrastructure.fs b/samples/Store/Domain.Tests/Infrastructure.fs index 2894e03fc..5c669a0a5 100644 --- a/samples/Store/Domain.Tests/Infrastructure.fs +++ b/samples/Store/Domain.Tests/Infrastructure.fs @@ -2,12 +2,15 @@ module Samples.Store.Domain.Tests.Infrastructure open Domain -open FsCheck +open FsCheck.FSharp open FSharp.UMX open Swensen.Unquote open System open global.Xunit +module Arb = + let generate<'t> = ArbMap.defaults |> ArbMap.generate<'t> + type FsCheckGenerators = static member SkuId = Arb.generate |> Gen.map SkuId |> Arb.fromGen diff --git a/samples/Store/Integration/CartIntegration.fs b/samples/Store/Integration/CartIntegration.fs index ab75d1a57..dc74ea1a8 100644 --- a/samples/Store/Integration/CartIntegration.fs +++ b/samples/Store/Integration/CartIntegration.fs @@ -47,7 +47,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip in Memory, correctly folding the events`` args = Async.RunSynchronously <| async { + let ``Can roundtrip in Memory, correctly folding the events`` args = async { let store = createMemoryStore () let service = createServiceMemory log store do! act service args @@ -59,13 +59,13 @@ type Tests(testOutputHelper) = return Cart.create (createCategory context |> Decider.resolve log) } [] - let ``Can roundtrip against EventStore, correctly folding the events without compaction semantics`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against EventStore, correctly folding the events without compaction semantics`` args = async { let! service = arrangeEs connectToLocalEventStoreNode createContext categoryGesStreamWithoutCustomAccessStrategy do! act service args } [] - let ``Can roundtrip against EventStore, correctly folding the events with RollingSnapshots`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against EventStore, correctly folding the events with RollingSnapshots`` args = async { let! service = arrangeEs connectToLocalEventStoreNode createContext categoryGesStreamWithRollingSnapshots do! act service args } @@ -75,13 +75,13 @@ type Tests(testOutputHelper) = Cart.create (createCategory context |> Decider.resolve log) [] - let ``Can roundtrip against Cosmos, correctly folding the events without custom access strategy`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events without custom access strategy`` args = async { let service = arrangeCosmos createPrimaryContext categoryCosmosStreamWithoutCustomAccessStrategy do! act service args } [] - let ``Can roundtrip against Cosmos, correctly folding the events with With Snapshotting`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events with With Snapshotting`` args = async { let service = arrangeCosmos createPrimaryContext categoryCosmosStreamWithSnapshotStrategy do! act service args } diff --git a/samples/Store/Integration/ContactPreferencesIntegration.fs b/samples/Store/Integration/ContactPreferencesIntegration.fs index 198b6cd71..c3b05ef01 100644 --- a/samples/Store/Integration/ContactPreferencesIntegration.fs +++ b/samples/Store/Integration/ContactPreferencesIntegration.fs @@ -39,7 +39,7 @@ type Tests(testOutputHelper) = test <@ value = actual @> } [] - let ``Can roundtrip in Memory, correctly folding the events`` args = Async.RunSynchronously <| async { + let ``Can roundtrip in Memory, correctly folding the events`` args = async { let store = createMemoryStore () let service = createServiceMemory log store do! act service args @@ -51,13 +51,13 @@ type Tests(testOutputHelper) = return ContactPreferences.create (createCategory context |> Decider.resolve log) } [] - let ``Can roundtrip against EventStore, correctly folding the events with normal semantics`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against EventStore, correctly folding the events with normal semantics`` args = async { let! service = arrangeEs connectToLocalEventStoreNode createContext categoryGesWithoutAccessStrategy do! act service args } [] - let ``Can roundtrip against EventStore, correctly folding the events with compaction semantics`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against EventStore, correctly folding the events with compaction semantics`` args = async { let! service = arrangeEs connectToLocalEventStoreNode createContext categoryGesWithOptimizedStorageSemantics do! act service args } @@ -67,19 +67,19 @@ type Tests(testOutputHelper) = ContactPreferences.create (createCategory context |> Decider.resolve log) [] - let ``Can roundtrip against Cosmos, correctly folding the events with Unoptimized semantics`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events with Unoptimized semantics`` args = async { let service = arrangeCosmos createPrimaryContext categoryCosmosUnoptimized defaultQueryMaxItems do! act service args } [] - let ``Can roundtrip against Cosmos, correctly folding the events with LatestKnownEvent semantics`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events with LatestKnownEvent semantics`` args = async { let service = arrangeCosmos createPrimaryContext categoryCosmosWithLatestKnownEventSemantics 1 do! act service args } [] - let ``Can roundtrip against Cosmos, correctly folding the events with RollingUnfold semantics`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events with RollingUnfold semantics`` args = async { let service = arrangeCosmos createPrimaryContext categoryCosmosRollingUnfolds defaultQueryMaxItems do! act service args } diff --git a/samples/Store/Integration/FavoritesIntegration.fs b/samples/Store/Integration/FavoritesIntegration.fs index d7f1d5b89..baa97b5b5 100644 --- a/samples/Store/Integration/FavoritesIntegration.fs +++ b/samples/Store/Integration/FavoritesIntegration.fs @@ -65,7 +65,7 @@ type Tests(testOutputHelper) = return version, items } [] - let ``Can roundtrip in Memory, correctly folding the events`` args = Async.RunSynchronously <| async { + let ``Can roundtrip in Memory, correctly folding the events`` args = async { let store = createMemoryStore () let service = createServiceMemory log store let! version, items = act service args @@ -73,7 +73,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip against EventStore, correctly folding the events`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against EventStore, correctly folding the events`` args = async { let client = connectToLocalEventStoreNode log let context = createContext client defaultBatchSize let service = createServiceGes log context @@ -82,7 +82,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip against Cosmos, correctly folding the events with caching`` (clientId, cmd) = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events with caching`` (clientId, cmd) = async { let context = createPrimaryContext log defaultQueryMaxItems let service = createServiceCosmosUnoptimizedButCached log context let clientId = clientId () // generate a fresh one per test so repeated runs start from a stable base @@ -100,7 +100,7 @@ type Tests(testOutputHelper) = rereadVersion2 =! items.LongLength } [] - let ``Can roundtrip against Cosmos, correctly folding the events`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events`` args = async { let context = createPrimaryContext log defaultQueryMaxItems let service = createServiceCosmosSnapshotsUncached log context let! version, items = act service args @@ -108,7 +108,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip against Cosmos, correctly folding the events with rolling unfolds`` args = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, correctly folding the events with rolling unfolds`` args = async { let context = createPrimaryContext log defaultQueryMaxItems let service = createServiceCosmosRollingStateUncached log context let! version, _items = act service args diff --git a/samples/Store/Integration/Infrastructure.fs b/samples/Store/Integration/Infrastructure.fs index fd8447223..a3aecccfd 100644 --- a/samples/Store/Integration/Infrastructure.fs +++ b/samples/Store/Integration/Infrastructure.fs @@ -1,9 +1,12 @@ namespace global open Domain -open FsCheck +open FsCheck.FSharp open System +module Arb = + let generate<'t> = ArbMap.defaults |> ArbMap.generate<'t> + type FsCheckGenerators = static member SkuId = Arb.generate |> Gen.map SkuId |> Arb.fromGen static member ContactPreferencesId = diff --git a/samples/Store/Integration/Integration.fsproj b/samples/Store/Integration/Integration.fsproj index 0b99f0aa5..501d81d4e 100644 --- a/samples/Store/Integration/Integration.fsproj +++ b/samples/Store/Integration/Integration.fsproj @@ -25,7 +25,7 @@ - + diff --git a/samples/Store/Integration/LogIntegration.fs b/samples/Store/Integration/LogIntegration.fs index 33fbdc827..3eba22327 100644 --- a/samples/Store/Integration/LogIntegration.fs +++ b/samples/Store/Integration/LogIntegration.fs @@ -103,7 +103,7 @@ type Tests(testOutputHelper) = // Protip: Debug this test to view standard metrics rendering [] - let ``Can roundtrip against EventStore, hooking, extracting and substituting metrics in the logging information`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against EventStore, hooking, extracting and substituting metrics in the logging information`` (ctx, skuId) = async { let batchSize = defaultBatchSize let buffer = ConcurrentQueue() let log = createLoggerWithMetricsExtraction buffer.Enqueue @@ -116,7 +116,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip against Cosmos, hooking, extracting and substituting metrics in the logging information`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against Cosmos, hooking, extracting and substituting metrics in the logging information`` (ctx, skuId) = async { let queryMaxItems = defaultQueryMaxItems let buffer = ConcurrentQueue() let log = createLoggerWithMetricsExtraction buffer.Enqueue diff --git a/tests/Equinox.CosmosStore.Integration/AccessStrategies.fs b/tests/Equinox.CosmosStore.Integration/AccessStrategies.fs index 5bf421363..92c666672 100644 --- a/tests/Equinox.CosmosStore.Integration/AccessStrategies.fs +++ b/tests/Equinox.CosmosStore.Integration/AccessStrategies.fs @@ -80,8 +80,8 @@ module SequenceCheck = createCategoryUnoptimized Events.codec Fold.initial Fold.fold (context, cache) |> Equinox.Decider.resolve log |> create module Props = - open FsCheck + open FsCheck.FSharp type EventsInTip = EventsInTip of int type EventCount = EventCount of int type GapGen = @@ -109,7 +109,7 @@ type UnoptimizedTipReadingCorrectness(testOutputHelper) = /// This test compares the experiences of cached and uncached paths to reading the same data within a given stream /// This is in order to shake out bugs and/or variation induced by the presence of stale state in the cache entry [] - let ``Can sync with competing writer with and without cache`` (instanceId, contextArgs, firstIsCached, Props.EventCount count1, Props.EventCount count2) = Async.RunSynchronously <| async { + let ``Can sync with competing writer with and without cache`` (instanceId, contextArgs, firstIsCached, Props.EventCount count1, Props.EventCount count2) = async { let context = createContext contextArgs let service1, service2 = let uncached = SequenceCheck.Config.createUncached log context diff --git a/tests/Equinox.CosmosStore.Integration/CosmosCoreIntegration.fs b/tests/Equinox.CosmosStore.Integration/CosmosCoreIntegration.fs index e4381695f..d2c864a13 100644 --- a/tests/Equinox.CosmosStore.Integration/CosmosCoreIntegration.fs +++ b/tests/Equinox.CosmosStore.Integration/CosmosCoreIntegration.fs @@ -32,7 +32,7 @@ type Tests(testOutputHelper) = test <@ float rus >= Seq.sum (Seq.map snd tripRequestCharges) @> [] - let append (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let append (eventsInTip, TestStream streamName) = async { capture.Clear() let ctx = createPrimaryEventsContext log defaultQueryMaxItems (if eventsInTip then 1 else 0) @@ -57,7 +57,7 @@ type Tests(testOutputHelper) = // It's conceivable that in the future we might allow zero-length batches as long as a sync mechanism leveraging the etags and unfolds update mechanisms // As it stands with the NoTipEvents stored proc, permitting empty batches a) yields an invalid state b) provides no conceivable benefit [] - let ``append Throws when passed an empty batch`` (TestStream streamName) = Async.RunSynchronously <| async { + let ``append Throws when passed an empty batch`` (TestStream streamName) = async { let ctx = createPrimaryEventsContext log defaultQueryMaxItems 10 let index = 0L @@ -100,7 +100,7 @@ type Tests(testOutputHelper) = let verifyCorrectEvents = verifyCorrectEventsEx Direction.Forward [] - let ``appendAtEnd and getNextIndex`` (eventsInTip, extras, TestStream streamName) = Async.RunSynchronously <| async { + let ``appendAtEnd and getNextIndex`` (eventsInTip, extras, TestStream streamName) = async { // If a fail triggers a rerun, we need to dump the previous log entries captured capture.Clear() @@ -163,7 +163,7 @@ type Tests(testOutputHelper) = } [] - let ``append - fails on non-matching`` (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let ``append - fails on non-matching`` (eventsInTip, TestStream streamName) = async { capture.Clear() let ctx = createPrimaryEventsContext log 10 (if eventsInTip then 1 else 0) @@ -201,7 +201,7 @@ type Tests(testOutputHelper) = (* Forward *) [] - let get (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let get (eventsInTip, TestStream streamName) = async { let ctx = createPrimaryEventsContext log 3 (if eventsInTip then 10 else 0) // We're going to ignore the first, to prove we can @@ -218,7 +218,7 @@ type Tests(testOutputHelper) = } [] - let ``get in 2 batches`` (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let ``get in 2 batches`` (eventsInTip, TestStream streamName) = async { let ctx = createPrimaryEventsContext log 1 (if eventsInTip then 1 else 0) let! expected = add6EventsIn2BatchesEx ctx streamName 2 @@ -234,7 +234,7 @@ type Tests(testOutputHelper) = } [] - let ``get Lazy`` (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let ``get Lazy`` (eventsInTip, TestStream streamName) = async { let ctx = createPrimaryEventsContext log 1 (if eventsInTip then 3 else 0) let! expected = add6EventsIn2BatchesEx ctx streamName 4 @@ -257,7 +257,7 @@ type Tests(testOutputHelper) = (* Backward *) [] - let getBackwards (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let getBackwards (eventsInTip, TestStream streamName) = async { let ctx = createPrimaryEventsContext log 1 (if eventsInTip then 1 else 0) let! expected = add6EventsIn2Batches ctx streamName @@ -274,7 +274,7 @@ type Tests(testOutputHelper) = } [] - let ``getBackwards in 2 batches`` (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let ``getBackwards in 2 batches`` (eventsInTip, TestStream streamName) = async { let ctx = createPrimaryEventsContext log 1 (if eventsInTip then 1 else 0) let! expected = add6EventsIn2BatchesEx ctx streamName 2 @@ -291,7 +291,7 @@ type Tests(testOutputHelper) = } [] - let ``getBackwards Lazy`` (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let ``getBackwards Lazy`` (eventsInTip, TestStream streamName) = async { let ctx = createPrimaryEventsContext log 1 (if eventsInTip then 3 else 0) let! expected = add6EventsIn2BatchesEx ctx streamName 4 @@ -321,7 +321,7 @@ type Tests(testOutputHelper) = (* Prune *) [] - let prune (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let prune (eventsInTip, TestStream streamName) = async { let ctx, ctxUnsafe = createPrimaryEventsContextWithUnsafe log 10 (if eventsInTip then 3 else 0) let! expected = add6EventsIn2BatchesEx ctx streamName 4 @@ -387,7 +387,7 @@ type Tests(testOutputHelper) = (* Fallback *) [] - let fallback (eventsInTip, TestStream streamName) = Async.RunSynchronously <| async { + let fallback (eventsInTip, TestStream streamName) = async { let ctx1, ctx1Unsafe = createPrimaryEventsContextWithUnsafe log 10 (if eventsInTip then 3 else 0) let ctx2 = createArchiveEventsContext log defaultQueryMaxItems let ctx12 = createFallbackEventsContext log defaultQueryMaxItems diff --git a/tests/Equinox.CosmosStore.Integration/CosmosFixturesInfrastructure.fs b/tests/Equinox.CosmosStore.Integration/CosmosFixturesInfrastructure.fs index c15d2f9a8..99ae05749 100644 --- a/tests/Equinox.CosmosStore.Integration/CosmosFixturesInfrastructure.fs +++ b/tests/Equinox.CosmosStore.Integration/CosmosFixturesInfrastructure.fs @@ -1,9 +1,12 @@ namespace global open Domain -open FsCheck +open FsCheck.FSharp open System +module Arb = + let generate<'t> = ArbMap.defaults |> ArbMap.generate<'t> + type FsCheckGenerators = static member SkuId = Arb.generate |> Gen.map SkuId |> Arb.fromGen static member ContactPreferencesId = diff --git a/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs b/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs index 0218484c7..5fa20dded 100644 --- a/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs +++ b/tests/Equinox.CosmosStore.Integration/DocumentStoreIntegration.fs @@ -98,7 +98,7 @@ type Tests(testOutputHelper) = #endif [] - let ``Can roundtrip against DocStore, correctly batching the reads`` (eventsInTip, cartContext, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against DocStore, correctly batching the reads`` (eventsInTip, cartContext, skuId) = async { capture.Clear() // for re-runs of the test let addRemoveCount = 40 let eventsPerAction = addRemoveCount * 2 - 1 @@ -141,7 +141,7 @@ type Tests(testOutputHelper) = #if STORE_DYNAMO [] - let ``Can read stream without traversing tip`` (cartContext, skuId, countToTry) = Async.RunSynchronously <| async { + let ``Can read stream without traversing tip`` (cartContext, skuId, countToTry) = async { capture.Clear() // for re-runs of the test let addRemoveCount = 40 let _expectedEvents = addRemoveCount * 2 - 1 @@ -165,7 +165,7 @@ type Tests(testOutputHelper) = #endif [] - let ``Can roundtrip against DocStore, managing sync conflicts by retrying`` (eventsInTip, ctx, initialState) = Async.RunSynchronously <| async { + let ``Can roundtrip against DocStore, managing sync conflicts by retrying`` (eventsInTip, ctx, initialState) = async { capture.Clear() let log1, capture1 = log, capture let queryMaxItems = 3 @@ -251,7 +251,7 @@ type Tests(testOutputHelper) = } [] - let ``Can correctly read and update Contacts against DocStore with LatestKnownEvent without Caching`` (eventsInTip, value: ContactPreferences.Events.Preferences) = Async.RunSynchronously <| async { + let ``Can correctly read and update Contacts against DocStore with LatestKnownEvent without Caching`` (eventsInTip, value: ContactPreferences.Events.Preferences) = async { let context = createPrimaryContextEx log 1 (if eventsInTip then 1 else 0) let service = ContactPreferences.createServiceWithoutCaching log context // We need to be sure every Update changes something as we rely on an expected number of events in the end @@ -308,7 +308,7 @@ type Tests(testOutputHelper) = } [] - let ``Can correctly read and update Contacts against DocStore with LatestKnownEvent`` value = Async.RunSynchronously <| async { + let ``Can correctly read and update Contacts against DocStore with LatestKnownEvent`` value = async { let context = createPrimaryContextEx log 1 10 let cache = Equinox.Cache("contacts", sizeMb = 50) let service = ContactPreferences.createServiceWithCaching log context cache @@ -331,7 +331,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip against DocStore with RollingState, detecting conflicts based on etag`` (ctx, initialState) = Async.RunSynchronously <| async { + let ``Can roundtrip against DocStore with RollingState, detecting conflicts based on etag`` (ctx, initialState) = async { let log1, capture1 = log, capture capture1.Clear() let context = createPrimaryContextEx log1 1 10 @@ -412,7 +412,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip against DocStore, using Snapshotting to avoid queries`` (cartContext, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against DocStore, using Snapshotting to avoid queries`` (cartContext, skuId) = async { let queryMaxItems = 10 let context = createPrimaryContextEx log queryMaxItems 10 let createServiceIndexed () = Cart.createServiceWithSnapshotStrategy log context @@ -463,7 +463,7 @@ type Tests(testOutputHelper) = } [] - let ``Can roundtrip against DocStore, correctly using Snapshotting and Cache to avoid redundant reads`` (eventsInTip, cartContext, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against DocStore, correctly using Snapshotting and Cache to avoid redundant reads`` (eventsInTip, cartContext, skuId) = async { let context = createPrimaryContextEx log 10 (if eventsInTip then 10 else 0) let cache = Equinox.Cache("cart", sizeMb = 50) let createServiceCached () = Cart.createServiceWithSnapshotStrategyAndCaching log context cache diff --git a/tests/Equinox.CosmosStore.Integration/Equinox.CosmosStore.Integration.fsproj b/tests/Equinox.CosmosStore.Integration/Equinox.CosmosStore.Integration.fsproj index a5c2b9dc1..1f4e9ed8b 100644 --- a/tests/Equinox.CosmosStore.Integration/Equinox.CosmosStore.Integration.fsproj +++ b/tests/Equinox.CosmosStore.Integration/Equinox.CosmosStore.Integration.fsproj @@ -23,7 +23,7 @@ - + diff --git a/tests/Equinox.DynamoStore.Integration/Equinox.DynamoStore.Integration.fsproj b/tests/Equinox.DynamoStore.Integration/Equinox.DynamoStore.Integration.fsproj index 260ac7388..f629916d4 100644 --- a/tests/Equinox.DynamoStore.Integration/Equinox.DynamoStore.Integration.fsproj +++ b/tests/Equinox.DynamoStore.Integration/Equinox.DynamoStore.Integration.fsproj @@ -30,7 +30,7 @@ - + diff --git a/tests/Equinox.EventStore.Integration/Equinox.EventStore.Integration.fsproj b/tests/Equinox.EventStore.Integration/Equinox.EventStore.Integration.fsproj index 61dfa2495..e3e48716c 100644 --- a/tests/Equinox.EventStore.Integration/Equinox.EventStore.Integration.fsproj +++ b/tests/Equinox.EventStore.Integration/Equinox.EventStore.Integration.fsproj @@ -19,7 +19,7 @@ - + diff --git a/tests/Equinox.EventStoreDb.Integration/Equinox.EventStoreDb.Integration.fsproj b/tests/Equinox.EventStoreDb.Integration/Equinox.EventStoreDb.Integration.fsproj index bfe85b8c3..bc8655944 100644 --- a/tests/Equinox.EventStoreDb.Integration/Equinox.EventStoreDb.Integration.fsproj +++ b/tests/Equinox.EventStoreDb.Integration/Equinox.EventStoreDb.Integration.fsproj @@ -19,7 +19,7 @@ - + diff --git a/tests/Equinox.EventStoreDb.Integration/Infrastructure.fs b/tests/Equinox.EventStoreDb.Integration/Infrastructure.fs index 6be857e96..1837d2e11 100644 --- a/tests/Equinox.EventStoreDb.Integration/Infrastructure.fs +++ b/tests/Equinox.EventStoreDb.Integration/Infrastructure.fs @@ -1,9 +1,12 @@ namespace global open Domain -open FsCheck +open FsCheck.FSharp open System +open FSharp.UMX +module Arb = + let generate<'t> = ArbMap.defaults |> ArbMap.generate<'t> type FsCheckGenerators = static member SkuId = Arb.generate |> Gen.map SkuId |> Arb.fromGen static member ContactPreferencesId = @@ -11,6 +14,7 @@ type FsCheckGenerators = |> Gen.map (fun x -> sprintf "%s@test.com" (x.ToString("N"))) |> Gen.map ContactPreferences.ClientId |> Arb.fromGen + static member RequestId = Arb.generate |> Gen.map (fun x -> RequestId.parse %x) |> Arb.fromGen #if STORE_POSTGRES || STORE_MSSQL || STORE_MYSQL open Equinox.SqlStreamStore diff --git a/tests/Equinox.EventStoreDb.Integration/StoreIntegration.fs b/tests/Equinox.EventStoreDb.Integration/StoreIntegration.fs index e183c230f..4ed04e091 100644 --- a/tests/Equinox.EventStoreDb.Integration/StoreIntegration.fs +++ b/tests/Equinox.EventStoreDb.Integration/StoreIntegration.fs @@ -199,7 +199,7 @@ type GeneralTests(testOutputHelper) = let batchForwardAndAppend = singleBatchForward @ [EsAct.Append] [] - let ``Can roundtrip against Store, correctly batching the reads [without any optimizations]`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against Store, correctly batching the reads [without any optimizations]`` (ctx, skuId) = async { #if NET use _ = source.StartActivity("Can roundtrip against Store, correctly batching the reads [without any optimizations]") #endif @@ -231,7 +231,7 @@ type GeneralTests(testOutputHelper) = } [] - let ``Can roundtrip against Store, managing sync conflicts by retrying [without any optimizations]`` (ctx, initialState) = Async.RunSynchronously <| async { + let ``Can roundtrip against Store, managing sync conflicts by retrying [without any optimizations]`` (ctx, initialState) = async { #if NET use _ = source.StartActivity("Can roundtrip against Store, managing sync conflicts by retrying [without any optimizations]") #endif @@ -329,7 +329,7 @@ type GeneralTests(testOutputHelper) = #endif [] - let ``Can correctly read and update against Store, with LatestKnownEvent Access Strategy`` id value = Async.RunSynchronously <| async { + let ``Can correctly read and update against Store, with LatestKnownEvent Access Strategy`` id value = async { #if NET use _ = source.StartActivity("Can correctly read and update against Store, with LatestKnownEvent Access Strategy") #endif @@ -353,7 +353,7 @@ type GeneralTests(testOutputHelper) = } [] - let ``Can roundtrip against Store, correctly caching to avoid redundant reads`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against Store, correctly caching to avoid redundant reads`` (ctx, skuId) = async { #if NET use _ = source.StartActivity("Can roundtrip against Store, correctly caching to avoid redundant reads") #endif @@ -419,7 +419,7 @@ type GeneralTests(testOutputHelper) = } [] - let ``Version is 0-based`` () = Async.RunSynchronously <| async { + let ``Version is 0-based`` () = async { #if NET use _ = source.StartActivity("Version is 0-based") #endif @@ -463,7 +463,7 @@ type RollingSnapshotTests(testOutputHelper) = let batchBackwardsAndAppend = singleBatchBackwards @ [EsAct.Append] [] - let ``Can roundtrip against Store, correctly compacting to avoid redundant reads`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against Store, correctly compacting to avoid redundant reads`` (ctx, skuId) = async { #if NET use _ = source.StartActivity("Can roundtrip against Store, correctly compacting to avoid redundant reads") #endif @@ -507,7 +507,7 @@ type RollingSnapshotTests(testOutputHelper) = } [] - let ``Can combine compaction with caching against Store`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can combine compaction with caching against Store`` (ctx, skuId) = async { let log, capture = output.CreateLoggerWithCapture() let! client = connectToLocalStore log let batchSize = 10 @@ -572,7 +572,7 @@ type AdjacentSnapshotTests(testOutputHelper) = let readSnapshotted = [EsAct.ReadLast; EsAct.SliceForward; EsAct.BatchForward] [] - let ``Can roundtrip against Store, correctly snapshotting to avoid redundant reads`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can roundtrip against Store, correctly snapshotting to avoid redundant reads`` (ctx, skuId) = async { #if NET use _ = source.StartActivity("Can roundtrip against Store, correctly snapshotting to avoid redundant reads") #endif @@ -618,7 +618,7 @@ type AdjacentSnapshotTests(testOutputHelper) = } [] - let ``Can combine snapshotting with caching against Store`` (ctx, skuId) = Async.RunSynchronously <| async { + let ``Can combine snapshotting with caching against Store`` (ctx, skuId) = async { let log, capture = output.CreateLoggerWithCapture() let! client = connectToLocalStore log let batchSize = 10 diff --git a/tests/Equinox.MessageDb.Integration/Equinox.MessageDb.Integration.fsproj b/tests/Equinox.MessageDb.Integration/Equinox.MessageDb.Integration.fsproj index 61a9f5439..5bc805578 100644 --- a/tests/Equinox.MessageDb.Integration/Equinox.MessageDb.Integration.fsproj +++ b/tests/Equinox.MessageDb.Integration/Equinox.MessageDb.Integration.fsproj @@ -19,7 +19,7 @@ - + diff --git a/tests/Equinox.SqlStreamStore.MsSql.Integration/Equinox.SqlStreamStore.MsSql.Integration.fsproj b/tests/Equinox.SqlStreamStore.MsSql.Integration/Equinox.SqlStreamStore.MsSql.Integration.fsproj index 39c444631..e09672596 100644 --- a/tests/Equinox.SqlStreamStore.MsSql.Integration/Equinox.SqlStreamStore.MsSql.Integration.fsproj +++ b/tests/Equinox.SqlStreamStore.MsSql.Integration/Equinox.SqlStreamStore.MsSql.Integration.fsproj @@ -19,7 +19,7 @@ - + diff --git a/tests/Equinox.SqlStreamStore.MySql.Integration/Equinox.SqlStreamStore.MySql.Integration.fsproj b/tests/Equinox.SqlStreamStore.MySql.Integration/Equinox.SqlStreamStore.MySql.Integration.fsproj index 53334bf98..358afa6fd 100644 --- a/tests/Equinox.SqlStreamStore.MySql.Integration/Equinox.SqlStreamStore.MySql.Integration.fsproj +++ b/tests/Equinox.SqlStreamStore.MySql.Integration/Equinox.SqlStreamStore.MySql.Integration.fsproj @@ -19,7 +19,7 @@ - + diff --git a/tests/Equinox.SqlStreamStore.Postgres.Integration/Equinox.SqlStreamStore.Postgres.Integration.fsproj b/tests/Equinox.SqlStreamStore.Postgres.Integration/Equinox.SqlStreamStore.Postgres.Integration.fsproj index d83b590e2..32589af2c 100644 --- a/tests/Equinox.SqlStreamStore.Postgres.Integration/Equinox.SqlStreamStore.Postgres.Integration.fsproj +++ b/tests/Equinox.SqlStreamStore.Postgres.Integration/Equinox.SqlStreamStore.Postgres.Integration.fsproj @@ -19,7 +19,7 @@ - +