Skip to content

Commit

Permalink
refactor: rename to Testcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
massix committed Jan 7, 2024
1 parent 77bd7d2 commit 0cc7a01
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import Data.Either (Either(..))
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Console as Console
import Test.TestContainers as TC
import Test.Testcontainers as TC
main :: Effect Unit
main = do
Expand Down Expand Up @@ -105,7 +105,7 @@ import Data.Either (Either(..))
import Effect (Effect)
import Effect.Aff (launchAff_)
import Effect.Console as Console
import Test.TestContainers as TC
import Test.Testcontainers as TC
main :: Effect Unit
main = do
Expand Down
4 changes: 2 additions & 2 deletions src/Test/TestContainers.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Test.TestContainers
module Test.Testcontainers
( exec
, getFirstMappedPort
, getHost
Expand Down Expand Up @@ -45,7 +45,7 @@ import Data.Either (Either(..))
import Effect (Effect)
import Effect.Aff.Class (class MonadAff, liftAff)
import Effect.Class (class MonadEffect, liftEffect)
import Test.TestContainers.Types (class IsImage, BindMounts, Capability, CopyContentToContainer, ExecResult, ExtraHost, FilePath, GenericContainer, IPCMode, Image(..), KV, MemorySize, Network(..), NetworkMode(..), PullPolicy, ResourcesQuota, StartedTestContainer, StartupTimeout, StoppedTestContainer, TestContainer(..), TmpFS, User, WaitStrategy, capToString, toImage)
import Test.Testcontainers.Types (class IsImage, BindMounts, Capability, CopyContentToContainer, ExecResult, ExtraHost, FilePath, GenericContainer, IPCMode, Image(..), KV, MemorySize, Network(..), NetworkMode(..), PullPolicy, ResourcesQuota, StartedTestContainer, StartupTimeout, StoppedTestContainer, TestContainer(..), TmpFS, User, WaitStrategy, capToString, toImage)

foreign import mkContainerImpl :: (GenericContainer -> TestContainer) -> String -> TestContainer
foreign import setExposedPortsImpl :: TestContainer -> (GenericContainer -> TestContainer) -> Array Int -> TestContainer
Expand Down
4 changes: 2 additions & 2 deletions src/Test/TestContainers/Compose.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Test.TestContainers.Compose
module Test.Testcontainers.Compose
( mkComposeEnvironment
, composeUp
, composeUpWithServices
Expand All @@ -24,7 +24,7 @@ import Effect.Aff.Class (class MonadAff, liftAff)
import Effect.Aff.Compat (EffectFn3)
import Effect.Class (class MonadEffect, liftEffect)
import Effect.Uncurried (EffectFn4, runEffectFn3, runEffectFn4)
import Test.TestContainers.Types (CreatedDockerComposeEnvironment, DockerComposeEnvironment(..), FilePath, Image(..), KV, PullPolicy, StartedDockerComposeEnvironment, StartedTestContainer, StoppedDockerComposeEnvironment, TestContainer(..), WaitStrategy)
import Test.Testcontainers.Types (CreatedDockerComposeEnvironment, DockerComposeEnvironment(..), FilePath, Image(..), KV, PullPolicy, StartedDockerComposeEnvironment, StartedTestContainer, StoppedDockerComposeEnvironment, TestContainer(..), WaitStrategy)

foreign import mkComposeEnvironmentImpl :: Fn2 FilePath (Array FilePath) CreatedDockerComposeEnvironment
foreign import setWaitStrategyImpl
Expand Down
6 changes: 3 additions & 3 deletions src/Test/TestContainers/Monad.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Test.TestContainers.Monad
module Test.Testcontainers.Monad
( WithContainer
, configure
, getContainer
Expand Down Expand Up @@ -33,8 +33,8 @@ module Test.TestContainers.Monad
import Prelude

import Data.Tuple (Tuple(..))
import Test.TestContainers (setAddedCapabilities, setBindMounts, setCommand, setCopyFilesToContainer, setDefaultLogDriver, setDroppedCapabilities, setEntrypoint, setEnvironment, setExposedPorts, setExtraHosts, setIpcMode, setLabels, setName, setNetwork, setNetworkAliases, setNetworkMode, setPrivilegedMode, setPullPolicy, setResourcesQuota, setReuse, setSharedMemorySize, setStartupTimeout, setTmpFs, setUser, setWaitStrategy, setWorkingDirectory)
import Test.TestContainers.Types (BindMounts, Capability, CopyContentToContainer, ExtraHost, FilePath, IPCMode, KV, MemorySize, Network, NetworkMode, PullPolicy, ResourcesQuota, StartupTimeout, TestContainer, TmpFS, User, WaitStrategy)
import Test.Testcontainers (setAddedCapabilities, setBindMounts, setCommand, setCopyFilesToContainer, setDefaultLogDriver, setDroppedCapabilities, setEntrypoint, setEnvironment, setExposedPorts, setExtraHosts, setIpcMode, setLabels, setName, setNetwork, setNetworkAliases, setNetworkMode, setPrivilegedMode, setPullPolicy, setResourcesQuota, setReuse, setSharedMemorySize, setStartupTimeout, setTmpFs, setUser, setWaitStrategy, setWorkingDirectory)
import Test.Testcontainers.Types (BindMounts, Capability, CopyContentToContainer, ExtraHost, FilePath, IPCMode, KV, MemorySize, Network, NetworkMode, PullPolicy, ResourcesQuota, StartupTimeout, TestContainer, TmpFS, User, WaitStrategy)

newtype WithContainer a = WithContainer { runConfiguration :: TestContainer -> Tuple a TestContainer }

Expand Down
4 changes: 2 additions & 2 deletions src/Test/TestContainers/Network.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Test.TestContainers.Network
module Test.Testcontainers.Network
( mkNetwork
, startNetwork
, getId
Expand All @@ -12,7 +12,7 @@ import Data.Either (Either(..))
import Effect.Aff.Class (class MonadAff, liftAff)
import Effect.Aff.Compat (EffectFn1, runEffectFn1)
import Effect.Class (class MonadEffect, liftEffect)
import Test.TestContainers.Types (GenericNetwork, Network(..), NetworkId, NetworkName, StartedNetwork)
import Test.Testcontainers.Types (GenericNetwork, Network(..), NetworkId, NetworkName, StartedNetwork)

foreign import mkNetworkImpl :: (GenericNetwork -> Network) -> Network
foreign import startNetworkImpl :: EffectFn1 GenericNetwork (Promise StartedNetwork)
Expand Down
2 changes: 1 addition & 1 deletion src/Test/TestContainers/Types.purs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Test.TestContainers.Types
module Test.Testcontainers.Types
( KV
, BindMounts
, FilePath
Expand Down
4 changes: 2 additions & 2 deletions test/Test/Basic.purs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import Test.Partials (forceRight)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual, shouldNotEqual, shouldSatisfy)
import Test.Spec.Assertions.String (shouldStartWith)
import Test.TestContainers (getFirstMappedPort, getHost, getId, getMappedPort, getName, setCommand, setName, setPrivilegedMode, setPullPolicy, setUser, setWorkingDirectory, withContainer)
import Test.TestContainers.Types (PullPolicy(..))
import Test.Testcontainers (getFirstMappedPort, getHost, getId, getMappedPort, getName, setCommand, setName, setPrivilegedMode, setPullPolicy, setUser, setWorkingDirectory, withContainer)
import Test.Testcontainers.Types (PullPolicy(..))
import Test.Utils (launchCommand, mkAffContainer)

basicTest :: Spec Unit
Expand Down
4 changes: 2 additions & 2 deletions test/Test/Binds.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import Node.Process as Process
import Test.Assertions (shouldInclude)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual)
import Test.TestContainers (setBindMounts, setCommand, setCopyFilesToContainer, setTmpFs, withContainer)
import Test.TestContainers.Types (CopyContentToContainer(..), FileMode(..))
import Test.Testcontainers (setBindMounts, setCommand, setCopyFilesToContainer, setTmpFs, withContainer)
import Test.Testcontainers.Types (CopyContentToContainer(..), FileMode(..))
import Test.Utils (launchCommand, mkAffContainer)

bindTest :: Spec Unit
Expand Down
6 changes: 3 additions & 3 deletions test/Test/Compose.purs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import Test.Assertions (shouldInclude)
import Test.Partials (forceLeft, forceRight)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (fail, shouldEqual, shouldSatisfy)
import Test.TestContainers (exec, getName)
import Test.TestContainers.Compose (composeDown, composeUp, composeUpWithServices, getContainer, mkComposeEnvironment, setEnvironment, setEnvironmentFile, setNoRecreate, setProfiles, setPullPolicy, setRebuild, setWaitStrategy, withCompose, withComposeContainer)
import Test.TestContainers.Types (DockerComposeEnvironment(..), PullPolicy(..), WaitStrategy(..))
import Test.Testcontainers (exec, getName)
import Test.Testcontainers.Compose (composeDown, composeUp, composeUpWithServices, getContainer, mkComposeEnvironment, setEnvironment, setEnvironmentFile, setNoRecreate, setProfiles, setPullPolicy, setRebuild, setWaitStrategy, withCompose, withComposeContainer)
import Test.Testcontainers.Types (DockerComposeEnvironment(..), PullPolicy(..), WaitStrategy(..))
import Test.Utils (launchCommand)

foreign import composeVersionImpl :: Effect (Promise String)
Expand Down
4 changes: 2 additions & 2 deletions test/Test/Entrypoint.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Effect.Aff (error, throwError)
import Test.Assertions (shouldInclude)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual)
import Test.TestContainers (setCommand, setCopyFilesToContainer, setEntrypoint, withContainer)
import Test.TestContainers.Types (CopyContentToContainer(..), FileMode(..))
import Test.Testcontainers (setCommand, setCopyFilesToContainer, setEntrypoint, withContainer)
import Test.Testcontainers.Types (CopyContentToContainer(..), FileMode(..))
import Test.Utils (launchCommand, mkAffContainer)

entrypointTest :: Spec Unit
Expand Down
2 changes: 1 addition & 1 deletion test/Test/EnvironmentVariables.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Effect.Aff (error, throwError)
import Test.Assertions (shouldInclude)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual)
import Test.TestContainers (setCommand, setEnvironment, withContainer)
import Test.Testcontainers (setCommand, setEnvironment, withContainer)
import Test.Utils (launchCommand, mkAffContainer)

environmentTest :: Spec Unit
Expand Down
4 changes: 2 additions & 2 deletions test/Test/Network.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import Test.Assertions (shouldInclude)
import Test.Partials (forceRight)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (fail, shouldEqual, shouldSatisfy)
import Test.TestContainers (setCommand, setExtraHosts, setNetwork, setNetworkAliases, withContainer)
import Test.TestContainers.Network (getId, getName, mkNetwork, startNetwork)
import Test.Testcontainers (setCommand, setExtraHosts, setNetwork, setNetworkAliases, withContainer)
import Test.Testcontainers.Network (getId, getName, mkNetwork, startNetwork)
import Test.Utils (launchCommand, mkAffContainer)

networkTest :: Spec Unit
Expand Down
4 changes: 2 additions & 2 deletions test/Test/NetworkMode.purs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import Data.Either (Either(..))
import Effect.Aff (error, throwError)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions.String (shouldContain)
import Test.TestContainers (setCommand, setNetworkMode, withContainer)
import Test.TestContainers.Types (NetworkMode(..))
import Test.Testcontainers (setCommand, setNetworkMode, withContainer)
import Test.Testcontainers.Types (NetworkMode(..))
import Test.Utils (mkAffContainer)

networkModeTest :: Spec Unit
Expand Down
4 changes: 2 additions & 2 deletions test/Test/Ports.purs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import Partial.Unsafe (unsafePartial)
import Test.Partials (forceRight)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual, shouldNotEqual, shouldSatisfy)
import Test.TestContainers (getFirstMappedPort, getMappedPort, setExposedPorts, setPullPolicy, setReuse, setWaitStrategy, withContainer)
import Test.TestContainers.Types (PullPolicy(..), WaitStrategy(..))
import Test.Testcontainers (getFirstMappedPort, getMappedPort, setExposedPorts, setPullPolicy, setReuse, setWaitStrategy, withContainer)
import Test.Testcontainers.Types (PullPolicy(..), WaitStrategy(..))
import Test.Utils (mkAffContainer)

portMappingTest :: Spec Unit
Expand Down
4 changes: 2 additions & 2 deletions test/Test/Privileged.purs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import Effect.Aff (error)
import Test.Assertions (shouldInclude)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual)
import Test.TestContainers (setPrivilegedMode, setWaitStrategy, withContainer)
import Test.TestContainers.Types (WaitStrategy(..))
import Test.Testcontainers (setPrivilegedMode, setWaitStrategy, withContainer)
import Test.Testcontainers.Types (WaitStrategy(..))
import Test.Utils (launchCommand, mkAffContainer)

privilegedTest :: Spec Unit
Expand Down
6 changes: 3 additions & 3 deletions test/Test/Utils.purs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import Effect.Aff.Class (class MonadAff)
import Partial.Unsafe (unsafePartial)
import Test.Partials (forceRight)
import Test.Spec.Assertions (shouldSatisfy)
import Test.TestContainers (exec, mkContainer)
import Test.TestContainers.Monad (WithContainer, configure, getContainer)
import Test.TestContainers.Types (class IsImage, TestContainer)
import Test.Testcontainers (exec, mkContainer)
import Test.Testcontainers.Monad (WithContainer, configure, getContainer)
import Test.Testcontainers.Types (class IsImage, TestContainer)

launchCommand :: m. MonadAff m => MonadThrow Error m => TestContainer -> Array String -> (String -> m Unit) -> (Int -> m Unit) -> m Unit
launchCommand c cmds vOutput vCode = do
Expand Down
6 changes: 3 additions & 3 deletions test/Test/WaitStrategy.purs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import Effect.Now (now)
import Test.Assertions (shouldInclude)
import Test.Spec (Spec, describe, it)
import Test.Spec.Assertions (shouldEqual, shouldSatisfy)
import Test.TestContainers (setCommand, setExposedPorts, setStartupTimeout, setWaitStrategy, withContainer)
import Test.TestContainers.Monad (setCommandM, setEnvironmentM, setStartupTimeoutM, setWaitStrategyM)
import Test.TestContainers.Types (StartupTimeout(..), WaitStrategy(..))
import Test.Testcontainers (setCommand, setExposedPorts, setStartupTimeout, setWaitStrategy, withContainer)
import Test.Testcontainers.Monad (setCommandM, setEnvironmentM, setStartupTimeoutM, setWaitStrategyM)
import Test.Testcontainers.Types (StartupTimeout(..), WaitStrategy(..))
import Test.Utils (launchCommand, mkAffContainer, mkAffContainerM)

waitStrategyTest :: Spec Unit
Expand Down

0 comments on commit 0cc7a01

Please sign in to comment.