on master help sign in
fixed log test

trying to kill a container which is not running leads to a "409 Conflict" error from the docker API. The container in the test should have already stopped, no need to kill it. A bug in the requestUnit method prevented the test from failing before.

commit6ed5b5890e2b282abba9731796bd70fb937cd4d9 authorSven Koschnicke <s.koschnicke@gfxpro.com> dateMon 30 Oct 2017, 20:03 (9 years ago) parentb4c6a2b
1 file changed+2−5
tests/tests.hs+2−5
tests/tests.hs+2−5
@@ -76,13 +76,11 @@ testRunAndReadLog =
7676 status1 <- startContainer defaultStartOpts c
7777 _ <- inspectContainer c >>= fromRight
7878 lift $ threadDelay 300000 -- give 300ms for the application to finish
79− lift $ assert $ isRightUnit status1
80− status2 <- killContainer SIGTERM c
79+ lift $ assertBool ("starting the container, unexpected status: " ++ show status1) $ isRightUnit status1
8180 logs <- getContainerLogs defaultLogOpts c >>= fromRight
82− lift $ assert $ isRightUnit status2
8381 lift $ assert $ (C.pack "123") `C.isInfixOf` (toStrict1 logs)
8482 status3 <- deleteContainer (DeleteOpts True True) c
85− lift $ assert $ isRightUnit status3
83+ lift $ assertBool ("deleting container, unexpected status: " ++ show status3) $ isRightUnit status3
8684 where
8785 isRightUnit (Right ()) = True
8886 isRightUnit _ = False
@@ -201,4 +199,3 @@ main = do
201199 Just _ -> do
202200 setup
203201 defaultMain $ testGroup "Tests" [jsonTests, integrationTests]
204−