| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Test.Hindsight.Store.TestRunner
Synopsis
- data EventStoreTestRunner backend = EventStoreTestRunner {
- withStore :: forall a. (BackendHandle backend -> IO a) -> IO ()
- withStores :: forall a. Int -> ([BackendHandle backend] -> IO a) -> IO ()
- runTest :: EventStoreTestRunner backend -> (BackendHandle backend -> IO ()) -> IO ()
- runMultiInstanceTest :: EventStoreTestRunner backend -> Int -> ([BackendHandle backend] -> IO ()) -> IO ()
- repeatTest :: Int -> TestName -> Assertion -> TestTree
- genericEventStoreTests :: (EventStore backend, StoreConstraints backend IO, Show (Cursor backend), Ord (Cursor backend)) => EventStoreTestRunner backend -> [TestTree]
- multiInstanceTests :: (EventStore backend, StoreConstraints backend IO, Show (Cursor backend)) => EventStoreTestRunner backend -> [TestTree]
- collectEventsUntilTombstone :: IORef [EventEnvelope UserCreated backend] -> EventHandler UserCreated IO backend
- handleTombstone :: MVar () -> EventHandler Tombstone IO backend
- extractUserInfo :: EventEnvelope UserCreated backend -> Maybe UserInformation2
Test Infrastructure
data EventStoreTestRunner backend Source #
Test runner for event store tests
Constructors
| EventStoreTestRunner | |
Fields
| |
runTest :: EventStoreTestRunner backend -> (BackendHandle backend -> IO ()) -> IO () Source #
Run a test with the test runner
runMultiInstanceTest :: EventStoreTestRunner backend -> Int -> ([BackendHandle backend] -> IO ()) -> IO () Source #
Run a multi-instance test with the test runner
Generic Test Suites
genericEventStoreTests :: (EventStore backend, StoreConstraints backend IO, Show (Cursor backend), Ord (Cursor backend)) => EventStoreTestRunner backend -> [TestTree] Source #
Common event store test cases split into basic and consistency tests
multiInstanceTests :: (EventStore backend, StoreConstraints backend IO, Show (Cursor backend)) => EventStoreTestRunner backend -> [TestTree] Source #
Multi-instance test cases (for backends that support cross-process subscriptions)
Helper Functions
collectEventsUntilTombstone :: IORef [EventEnvelope UserCreated backend] -> EventHandler UserCreated IO backend Source #
Helper functions
handleTombstone :: MVar () -> EventHandler Tombstone IO backend Source #
extractUserInfo :: EventEnvelope UserCreated backend -> Maybe UserInformation2 Source #