From de6b2d85ef2e0fc8e255f4da37ddedb44a48e6c8 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 31 Oct 2019 17:26:18 +1000 Subject: [PATCH] Integration tests: logging is shut down when CLI finished --- .../Jormungandr/Scenario/CLI/Server.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/jormungandr/test/integration/Test/Integration/Jormungandr/Scenario/CLI/Server.hs b/lib/jormungandr/test/integration/Test/Integration/Jormungandr/Scenario/CLI/Server.hs index 6a355a28a8a..b39b65ca09e 100644 --- a/lib/jormungandr/test/integration/Test/Integration/Jormungandr/Scenario/CLI/Server.hs +++ b/lib/jormungandr/test/integration/Test/Integration/Jormungandr/Scenario/CLI/Server.hs @@ -159,6 +159,22 @@ spec = do -- -- but in practice, we only have INFO logs on start-up. + it "LOGGING - Serve shuts down logging correctly" $ \ctx -> do + let args = + ["serve" + , "--database" + , "/does-not-exist" + , "--node-port" + , show (ctx ^. typed @(Port "node")) + , "--random-port" + , "--verbose" + , "--genesis-block-hash" + , block0H + ] + let process = proc' (commandName @t) args + (out, _) <- collectStreams (2, 0) process + out `shouldContainT` "Logging shutdown." + describe "LOGGING - Exits nicely on wrong genesis hash" $ do let hashes = [ replicate 40 '1'