hindsight-core:store-testing
Safe HaskellNone
LanguageGHC2021

Test.Hindsight.Store.TestRunner

Synopsis

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

extractUserInfo :: EventEnvelope UserCreated backend -> Maybe UserInformation2 Source #