Skip to content

Commit

Permalink
Skip testcontainer tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 21, 2024
1 parent 3c8ddda commit d941ed4
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions test/HaskellWorks/Polysemy/TestContainers/LocalStackSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,29 @@ import HaskellWorks.Polysemy.Amazonka.LocalStack
import HaskellWorks.Polysemy.Hedgehog
import HaskellWorks.Prelude
import Polysemy
import qualified System.Info as OS
import qualified TestContainers.Tasty as TC

{- HLINT ignore "Use camelCase" -}

isWindows :: Bool
isWindows = OS.os == "mingw32"

tasty_local_stack :: Tasty.TestTree
tasty_local_stack =
TC.withContainers (setupContainers' "localstack/localstack-pro:3.7.2") $ \getContainer ->
H.testProperty "Local stack test" $ propertyOnce $ runLocalTestEnv getContainer $ do
container <- embed getContainer
ep <- getLocalStackEndpoint container
jotYamlM_ $ inspectContainer container
jotShow_ ep
listBucketsReq <- pure AWS.newListBuckets

listBucketResp <- sendAws listBucketsReq
& jotShowDataLog @AwsLogEntry
& trapFail

jotShow_ listBucketResp
if isWindows
then Tasty.testGroup "LocalStackSpec skipped on Windows" []
else
TC.withContainers (setupContainers' "localstack/localstack-pro:3.7.2") $ \getContainer ->
H.testProperty "Local stack test" $ propertyOnce $ runLocalTestEnv getContainer $ do
container <- embed getContainer
ep <- getLocalStackEndpoint container
jotYamlM_ $ inspectContainer container
jotShow_ ep
listBucketsReq <- pure AWS.newListBuckets

listBucketResp <- sendAws listBucketsReq
& jotShowDataLog @AwsLogEntry
& trapFail

jotShow_ listBucketResp

0 comments on commit d941ed4

Please sign in to comment.