Skip to content

Commit

Permalink
Remove unused TinyLog effect
Browse files Browse the repository at this point in the history
  • Loading branch information
pcapriotti committed Aug 31, 2021
1 parent 6eeff52 commit 751c026
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion services/federator/src/Federator/Remote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ blessedCiphers =
mkGrpcClient ::
Members
'[ Embed IO,
TinyLog,
Polysemy.Error RemoteError,
Polysemy.Reader TLSSettings
]
Expand Down
7 changes: 2 additions & 5 deletions services/federator/test/unit/Test/Federator/Remote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import qualified Network.Wai.Handler.WarpTLS as WarpTLS
import Polysemy
import qualified Polysemy.Error as Polysemy
import qualified Polysemy.Reader as Polysemy
import qualified Polysemy.TinyLog as TinyLog
import Test.Federator.Options (defRunSettings)
import Test.Tasty
import Test.Tasty.HUnit
Expand Down Expand Up @@ -60,18 +59,17 @@ testValidatesCertificateSuccess =
[ testCase "when hostname=localhost and certificate-for=localhost" $ do
bracket (startMockServer certForLocalhost) (\(serverThread, _) -> Async.cancel serverThread) $ \(_, port) -> do
tlsSettings <- mkTLSSettings settings
void . Polysemy.runM . assertNoError @RemoteError . TinyLog.discardLogs . Polysemy.runReader tlsSettings $ mkGrpcClient (SrvTarget "localhost" (fromIntegral port)),
void . Polysemy.runM . assertNoError @RemoteError . Polysemy.runReader tlsSettings $ mkGrpcClient (SrvTarget "localhost" (fromIntegral port)),
testCase "when hostname=localhost. and certificate-for=localhost" $ do
bracket (startMockServer certForLocalhost) (\(serverThread, _) -> Async.cancel serverThread) $ \(_, port) -> do
tlsSettings <- mkTLSSettings settings
void . Polysemy.runM . assertNoError @RemoteError . TinyLog.discardLogs . Polysemy.runReader tlsSettings $ mkGrpcClient (SrvTarget "localhost." (fromIntegral port)),
void . Polysemy.runM . assertNoError @RemoteError . Polysemy.runReader tlsSettings $ mkGrpcClient (SrvTarget "localhost." (fromIntegral port)),
-- This is a limitation of the TLS library, this test just exists to document that.
testCase "when hostname=localhost. and certificate-for=localhost." $ do
bracket (startMockServer certForLocalhostDot) (\(serverThread, _) -> Async.cancel serverThread) $ \(_, port) -> do
tlsSettings <- mkTLSSettings settings
eitherClient <-
Polysemy.runM
. TinyLog.discardLogs
. Polysemy.runError @RemoteError
. Polysemy.runReader tlsSettings
$ mkGrpcClient (SrvTarget "localhost." (fromIntegral port))
Expand All @@ -90,7 +88,6 @@ testValidatesCertificateWrongHostname =
eitherClient <-
Polysemy.runM
. Polysemy.runError
. TinyLog.discardLogs
. Polysemy.runReader tlsSettings
$ mkGrpcClient (SrvTarget "localhost." (fromIntegral port))
case eitherClient of
Expand Down

0 comments on commit 751c026

Please sign in to comment.