{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Test.Hindsight.Store (
EventStoreTestRunner (..),
genericEventStoreTests,
multiInstanceTests,
basicTests,
consistencyTests,
cursorTests,
streamVersionTests,
multiInstanceEventOrderingTests,
orderingTests,
propertyTests,
stressTests,
module Test.Hindsight.Store.Common,
)
where
import Hindsight.Store (Cursor, EventStore, StoreConstraints)
import Test.Hindsight.Store.BasicTests (basicTests)
import Test.Hindsight.Store.Common
import Test.Hindsight.Store.ConsistencyTests (consistencyTests)
import Test.Hindsight.Store.CursorTests (cursorTests)
import Test.Hindsight.Store.MultiInstanceEventOrderingTests (multiInstanceEventOrderingTests)
import Test.Hindsight.Store.OrderingTests (orderingTests)
import Test.Hindsight.Store.PropertyTests (propertyTests)
import Test.Hindsight.Store.StreamVersionTests (streamVersionTests)
import Test.Hindsight.Store.StressTests (stressTests)
import Test.Hindsight.Store.TestRunner (EventStoreTestRunner (..))
import Test.Tasty
genericEventStoreTests ::
forall backend.
(EventStore backend, StoreConstraints backend IO, Show (Cursor backend), Ord (Cursor backend)) =>
EventStoreTestRunner backend ->
[TestTree]
genericEventStoreTests :: forall backend.
(EventStore backend, StoreConstraints backend IO,
Show (Cursor backend), Ord (Cursor backend)) =>
EventStoreTestRunner backend -> [TestTree]
genericEventStoreTests EventStoreTestRunner backend
runner =
[ TestName -> [TestTree] -> TestTree
testGroup TestName
"Basic Tests" (EventStoreTestRunner backend -> [TestTree]
forall backend.
(EventStore backend, StoreConstraints backend IO,
Show (Cursor backend)) =>
EventStoreTestRunner backend -> [TestTree]
basicTests EventStoreTestRunner backend
runner)
, TestName -> [TestTree] -> TestTree
testGroup TestName
"Stream Version Tests" (EventStoreTestRunner backend -> [TestTree]
forall backend.
(EventStore backend, StoreConstraints backend IO) =>
EventStoreTestRunner backend -> [TestTree]
streamVersionTests EventStoreTestRunner backend
runner)
, TestName -> [TestTree] -> TestTree
testGroup TestName
"Consistency Tests" (EventStoreTestRunner backend -> [TestTree]
forall backend.
(EventStore backend, StoreConstraints backend IO,
Show (Cursor backend), Show (EventStoreError backend)) =>
EventStoreTestRunner backend -> [TestTree]
consistencyTests EventStoreTestRunner backend
runner)
, TestName -> [TestTree] -> TestTree
testGroup TestName
"Per-Stream Cursor Tests" (EventStoreTestRunner backend -> [TestTree]
forall backend.
(EventStore backend, StoreConstraints backend IO,
Show (Cursor backend), Ord (Cursor backend)) =>
EventStoreTestRunner backend -> [TestTree]
cursorTests EventStoreTestRunner backend
runner)
]
multiInstanceTests ::
forall backend.
(EventStore backend, StoreConstraints backend IO, Show (Cursor backend), Ord (Cursor backend)) =>
EventStoreTestRunner backend ->
[TestTree]
multiInstanceTests :: forall backend.
(EventStore backend, StoreConstraints backend IO,
Show (Cursor backend), Ord (Cursor backend)) =>
EventStoreTestRunner backend -> [TestTree]
multiInstanceTests EventStoreTestRunner backend
runner = EventStoreTestRunner backend -> [TestTree]
forall backend.
(EventStore backend, StoreConstraints backend IO,
Show (Cursor backend), Ord (Cursor backend)) =>
EventStoreTestRunner backend -> [TestTree]
multiInstanceEventOrderingTests EventStoreTestRunner backend
runner