fix tests broken by previous commit (#69)

This commit is contained in:
ryan4729 2018-10-09 17:29:29 -07:00 committed by Parnell Springmeyer
parent 24bdacca3a
commit c80269089c
3 changed files with 8 additions and 5 deletions

View file

@ -674,7 +674,7 @@ testCustomUserAgent =
where where
clientArgs = [UserAgentPrefix "prefix!", UserAgentSuffix "suffix!"] clientArgs = [UserAgentPrefix "prefix!", UserAgentSuffix "suffix!"]
client = client =
TestClient (ClientConfig "localhost" 50051 clientArgs Nothing) $ TestClient (ClientConfig "localhost" 50051 clientArgs Nothing Nothing) $
\c -> do rm <- clientRegisterMethodNormal c "/foo" \c -> do rm <- clientRegisterMethodNormal c "/foo"
void $ clientRequest c rm 4 "" mempty void $ clientRequest c rm 4 "" mempty
server = TestServer (serverConf (["/foo"],[],[],[])) $ \s -> do server = TestServer (serverConf (["/foo"],[],[],[])) $ \s -> do
@ -698,6 +698,7 @@ testClientCompression =
"localhost" "localhost"
50051 50051
[CompressionAlgArg GrpcCompressDeflate] [CompressionAlgArg GrpcCompressDeflate]
Nothing
Nothing) $ \c -> do Nothing) $ \c -> do
rm <- clientRegisterMethodNormal c "/foo" rm <- clientRegisterMethodNormal c "/foo"
void $ clientRequest c rm 1 "hello" mempty void $ clientRequest c rm 1 "hello" mempty
@ -716,6 +717,7 @@ testClientServerCompression =
50051 50051
[CompressionAlgArg GrpcCompressDeflate] [CompressionAlgArg GrpcCompressDeflate]
Nothing Nothing
Nothing
client = TestClient cconf $ \c -> do client = TestClient cconf $ \c -> do
rm <- clientRegisterMethodNormal c "/foo" rm <- clientRegisterMethodNormal c "/foo"
clientRequest c rm 1 "hello" mempty >>= do clientRequest c rm 1 "hello" mempty >>= do
@ -746,6 +748,7 @@ testClientServerCompressionLvl =
50051 50051
[CompressionLevelArg GrpcCompressLevelHigh] [CompressionLevelArg GrpcCompressLevelHigh]
Nothing Nothing
Nothing
client = TestClient cconf $ \c -> do client = TestClient cconf $ \c -> do
rm <- clientRegisterMethodNormal c "/foo" rm <- clientRegisterMethodNormal c "/foo"
clientRequest c rm 1 "hello" mempty >>= do clientRequest c rm 1 "hello" mempty >>= do
@ -787,7 +790,7 @@ testClientMaxReceiveMessageLengthChannelArg = do
rm <- clientRegisterMethodNormal c "/foo" rm <- clientRegisterMethodNormal c "/foo"
clientRequest c rm 1 pay mempty >>= k clientRequest c rm 1 pay mempty >>= k
where where
conf = ClientConfig "localhost" 50051 [MaxReceiveMessageLength n] Nothing conf = ClientConfig "localhost" 50051 [MaxReceiveMessageLength n] Nothing Nothing
-- Expect success when the max recv payload size is set to 4 bytes, and we -- Expect success when the max recv payload size is set to 4 bytes, and we
-- are sent 4. -- are sent 4.
@ -885,7 +888,7 @@ stdTestClient :: (Client -> IO ()) -> TestClient
stdTestClient = TestClient stdClientConf stdTestClient = TestClient stdClientConf
stdClientConf :: ClientConfig stdClientConf :: ClientConfig
stdClientConf = ClientConfig "localhost" 50051 [] Nothing stdClientConf = ClientConfig "localhost" 50051 [] Nothing Nothing
data TestServer = TestServer ServerConfig (Server -> IO ()) data TestServer = TestServer ServerConfig (Server -> IO ())

View file

@ -62,7 +62,7 @@ serverConf :: ServerConfig
serverConf = ServerConfig "localhost" 50051 [("/foo")] [] [] [] [] Nothing serverConf = ServerConfig "localhost" 50051 [("/foo")] [] [] [] [] Nothing
clientConf :: ClientConfig clientConf :: ClientConfig
clientConf = ClientConfig "localhost" 50051 [] Nothing clientConf = ClientConfig "localhost" 50051 [] Nothing Nothing
clientEmptySendOps :: [Op] clientEmptySendOps :: [Op]
clientEmptySendOps = [OpSendInitialMetadata mempty, clientEmptySendOps = [OpSendInitialMetadata mempty,

View file

@ -124,7 +124,7 @@ main :: IO ()
main = do main = do
threadDelay 10000000 threadDelay 10000000
withGRPC $ \grpc -> withGRPC $ \grpc ->
withClient grpc (ClientConfig "localhost" 50051 [] Nothing) $ \client -> withClient grpc (ClientConfig "localhost" 50051 [] Nothing Nothing) $ \client ->
do service <- simpleServiceClient client do service <- simpleServiceClient client
(defaultMain $ testGroup "Send gRPC requests" (defaultMain $ testGroup "Send gRPC requests"