mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-26 21:19:43 +01:00
Group client and server tests together
This commit is contained in:
parent
48c9545fdb
commit
2119ef4b16
1 changed files with 15 additions and 15 deletions
|
@ -19,11 +19,11 @@ lowLevelTests :: TestTree
|
|||
lowLevelTests = testGroup "Unit tests of low-level Haskell library"
|
||||
[ testGRPCBracket
|
||||
, testCompletionQueueCreateDestroy
|
||||
, testServerCreateDestroy
|
||||
, testClientCreateDestroy
|
||||
, testWithServerCall
|
||||
, testWithClientCall
|
||||
, testClientCall
|
||||
, testClientTimeoutNoServer
|
||||
, testServerCreateDestroy
|
||||
, testServerCall
|
||||
, testServerTimeoutNoClient
|
||||
-- , testWrongEndpoint
|
||||
, testPayload
|
||||
|
@ -39,22 +39,12 @@ testCompletionQueueCreateDestroy =
|
|||
testCase "Create/destroy CQ" $ withGRPC $ \g ->
|
||||
withCompletionQueue g nop
|
||||
|
||||
testServerCreateDestroy :: TestTree
|
||||
testServerCreateDestroy =
|
||||
serverOnlyTest "start/stop" [] nop
|
||||
|
||||
testClientCreateDestroy :: TestTree
|
||||
testClientCreateDestroy =
|
||||
clientOnlyTest "start/stop" nop
|
||||
|
||||
testWithServerCall :: TestTree
|
||||
testWithServerCall =
|
||||
serverOnlyTest "create/destroy call" [] $ \s -> do
|
||||
r <- withServerUnregCall s 1 $ const $ return $ Right ()
|
||||
r @?= Left GRPCIOTimeout
|
||||
|
||||
testWithClientCall :: TestTree
|
||||
testWithClientCall =
|
||||
testClientCall :: TestTree
|
||||
testClientCall =
|
||||
clientOnlyTest "create/destroy call" $ \c -> do
|
||||
r <- withClientCall c "foo" 10 $ const $ return $ Right ()
|
||||
r @?= Right ()
|
||||
|
@ -66,6 +56,16 @@ testClientTimeoutNoServer =
|
|||
r <- clientRegisteredRequest c rm 1 "Hello" mempty
|
||||
r @?= Left GRPCIOTimeout
|
||||
|
||||
testServerCreateDestroy :: TestTree
|
||||
testServerCreateDestroy =
|
||||
serverOnlyTest "start/stop" [] nop
|
||||
|
||||
testServerCall :: TestTree
|
||||
testServerCall =
|
||||
serverOnlyTest "create/destroy call" [] $ \s -> do
|
||||
r <- withServerUnregCall s 1 $ const $ return $ Right ()
|
||||
r @?= Left GRPCIOTimeout
|
||||
|
||||
testServerTimeoutNoClient :: TestTree
|
||||
testServerTimeoutNoClient =
|
||||
serverOnlyTest "wait timeout when client DNE" [("/foo", Normal)] $ \s -> do
|
||||
|
|
Loading…
Reference in a new issue