Popularity
0.5
-
Activity
2.2
Declining
1
0
0
Monthly Downloads: 26
Programming language: Haskell
License: MIT License
Tags:
Development
Latest version: v0.2.0.0
testcontainers alternatives and similar packages
Based on the "Development" category.
Alternatively, view testcontainers alternatives based on common mentions on social networks and blogs.
-
ShellCheck
ShellCheck, a static analysis tool for shell scripts -
hadolint
Dockerfile linter, validate inline bash, written in Haskell -
stgi
A user-centric visual STG implementation to help understand GHC/Haskell's execution model. -
retrie
Retrie is a powerful, easy-to-use codemodding tool for Haskell. -
haskell-lsp
Haskell library for the Microsoft Language Server Protocol -
criterion
A powerful but simple library for measuring the performance of Haskell code. -
structured-haskell-mode
Structured editing minor mode for Haskell in Emacs -
cabal-install-parsers
Scripts and instructions for using CI services (e.g. Travis CI or Appveyor) with multiple GHC configurations -
inline-c
Write Haskell source files including C code inline. No FFI required. -
inline-java
Haskell/Java interop via inline Java code in Haskell modules. -
gi-atk
Generate Haskell bindings for GObject-Introspection capable libraries -
fourmolu
A fourk of ormolu that uses four space indentation and allows arbitrary configuration. Don't like it? PRs welcome! -
lambdabot
A friendly IRC bot and apprentice coder, written in Haskell. -
lambdabot-core
A friendly IRC bot and apprentice coder, written in Haskell. -
scion
OLD, DEPRECATED: Use this instead https://github.com/haskell/haskell-ide-engine -
threadscope
A graphical tool for profiling parallel Haskell programs
Access the most powerful time series database as a service
Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.
Promo
www.influxdata.com
Do you think we are missing an alternative of testcontainers or a related project?
Popular Comparisons
README
About
Testcontainers is a Haskell library that provides a friendly API to run Docker containers. It is designed to create a runtime environment to use during your integration tests
Example
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Main where
import qualified Test.Tasty as Tasty
import qualified Test.Tasty.HUnit as Tasty
import qualified TestContainers.Tasty as TC
data Endpoints = Endpoints
{
redisHost :: String
, redisPort :: Int
}
-- | Sets up and runs the containers required for this test suite.
setupContainers :: TC.MonadDocker m => m Endpoints
setupContainers = do
-- Launch the container based on the redis:5.0.0 image.
redisContainer <- TC.run $ TC.containerRequest (TC.fromTag "redis:5.0.0")
-- Expose the port 6379 from within the container. The respective port
-- on the host machine can be looked up using `containerPort` (see below).
TC.& TC.setExpose [ 6379 ]
-- Wait until the container is ready to accept requests. `run` blocks until
-- readiness can be established.
TC.& TC.setWaitingFor (TC.waitUntilMappedPortReachable 6379)
pure $ Endpoints
{
redisHost = "0.0.0.0"
, redisPort =
-- Look up the corresponding port on the host machine for the exposed
-- port 6379.
TC.containerPort redisContainer 6379
}
main :: IO ()
main =
Tasty.defaultMain $
-- Use `withContainers` to make the containers available in the closed over
-- tests. Due to how Tasty handles resources `withContainers` passes down
-- an IO action `start` to actually start up the containers. `start` can be
-- invoked multiple times, Tasty makes sure to only start up the containrs
-- once.
--
-- `withContainers` ensures the started containers are shut down correctly
-- once execution leaves its scope.
TC.withContainers setupContainers $ \start ->
Tasty.testGroup "Some test group"
[
Tasty.testCase "Redis test" $ do
-- Actually start the containers!!
Endpoints {..} <- start
-- ... assert some properties
pure ()
, Tasty.testCase "Another Redis test" $ do
-- Invoking `start` twice gives the same Endpoints!
Endpoints {..} <- start
-- ... assert some properties
pure ()
]