From 0cc7a012db701808ed2e088146fc6b67d3bc0946 Mon Sep 17 00:00:00 2001 From: Massimo Gengarelli Date: Sun, 7 Jan 2024 08:05:05 +0100 Subject: [PATCH] refactor: rename to `Testcontainers` --- README.md | 4 ++-- src/Test/TestContainers.purs | 4 ++-- src/Test/TestContainers/Compose.purs | 4 ++-- src/Test/TestContainers/Monad.purs | 6 +++--- src/Test/TestContainers/Network.purs | 4 ++-- src/Test/TestContainers/Types.purs | 2 +- test/Test/Basic.purs | 4 ++-- test/Test/Binds.purs | 4 ++-- test/Test/Compose.purs | 6 +++--- test/Test/Entrypoint.purs | 4 ++-- test/Test/EnvironmentVariables.purs | 2 +- test/Test/Network.purs | 4 ++-- test/Test/NetworkMode.purs | 4 ++-- test/Test/Ports.purs | 4 ++-- test/Test/Privileged.purs | 4 ++-- test/Test/Utils.purs | 6 +++--- test/Test/WaitStrategy.purs | 6 +++--- 17 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 1528c73..51d7faf 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/src/Test/TestContainers.purs b/src/Test/TestContainers.purs index 1c7f723..843cb36 100644 --- a/src/Test/TestContainers.purs +++ b/src/Test/TestContainers.purs @@ -1,4 +1,4 @@ -module Test.TestContainers +module Test.Testcontainers ( exec , getFirstMappedPort , getHost @@ -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 diff --git a/src/Test/TestContainers/Compose.purs b/src/Test/TestContainers/Compose.purs index b6f7139..05bc427 100644 --- a/src/Test/TestContainers/Compose.purs +++ b/src/Test/TestContainers/Compose.purs @@ -1,4 +1,4 @@ -module Test.TestContainers.Compose +module Test.Testcontainers.Compose ( mkComposeEnvironment , composeUp , composeUpWithServices @@ -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 diff --git a/src/Test/TestContainers/Monad.purs b/src/Test/TestContainers/Monad.purs index 1350435..8dc41da 100644 --- a/src/Test/TestContainers/Monad.purs +++ b/src/Test/TestContainers/Monad.purs @@ -1,4 +1,4 @@ -module Test.TestContainers.Monad +module Test.Testcontainers.Monad ( WithContainer , configure , getContainer @@ -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 } diff --git a/src/Test/TestContainers/Network.purs b/src/Test/TestContainers/Network.purs index 3e01ec3..5c4644c 100644 --- a/src/Test/TestContainers/Network.purs +++ b/src/Test/TestContainers/Network.purs @@ -1,4 +1,4 @@ -module Test.TestContainers.Network +module Test.Testcontainers.Network ( mkNetwork , startNetwork , getId @@ -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) diff --git a/src/Test/TestContainers/Types.purs b/src/Test/TestContainers/Types.purs index a0c2690..1a3b8e1 100644 --- a/src/Test/TestContainers/Types.purs +++ b/src/Test/TestContainers/Types.purs @@ -1,4 +1,4 @@ -module Test.TestContainers.Types +module Test.Testcontainers.Types ( KV , BindMounts , FilePath diff --git a/test/Test/Basic.purs b/test/Test/Basic.purs index 4832663..61fe44e 100644 --- a/test/Test/Basic.purs +++ b/test/Test/Basic.purs @@ -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 diff --git a/test/Test/Binds.purs b/test/Test/Binds.purs index 438fa4f..ebea29d 100644 --- a/test/Test/Binds.purs +++ b/test/Test/Binds.purs @@ -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 diff --git a/test/Test/Compose.purs b/test/Test/Compose.purs index ff1b660..41f15ea 100644 --- a/test/Test/Compose.purs +++ b/test/Test/Compose.purs @@ -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) diff --git a/test/Test/Entrypoint.purs b/test/Test/Entrypoint.purs index 02cf20c..2de817f 100644 --- a/test/Test/Entrypoint.purs +++ b/test/Test/Entrypoint.purs @@ -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 diff --git a/test/Test/EnvironmentVariables.purs b/test/Test/EnvironmentVariables.purs index e58c1c8..cfc55ad 100644 --- a/test/Test/EnvironmentVariables.purs +++ b/test/Test/EnvironmentVariables.purs @@ -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 diff --git a/test/Test/Network.purs b/test/Test/Network.purs index 2921764..d2e445b 100644 --- a/test/Test/Network.purs +++ b/test/Test/Network.purs @@ -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 diff --git a/test/Test/NetworkMode.purs b/test/Test/NetworkMode.purs index b124d02..39b4c9c 100644 --- a/test/Test/NetworkMode.purs +++ b/test/Test/NetworkMode.purs @@ -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 diff --git a/test/Test/Ports.purs b/test/Test/Ports.purs index 5ed5c64..6f4362c 100644 --- a/test/Test/Ports.purs +++ b/test/Test/Ports.purs @@ -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 diff --git a/test/Test/Privileged.purs b/test/Test/Privileged.purs index 9388ca2..28cda05 100644 --- a/test/Test/Privileged.purs +++ b/test/Test/Privileged.purs @@ -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 diff --git a/test/Test/Utils.purs b/test/Test/Utils.purs index 102dd7e..978a117 100644 --- a/test/Test/Utils.purs +++ b/test/Test/Utils.purs @@ -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 diff --git a/test/Test/WaitStrategy.purs b/test/Test/WaitStrategy.purs index 826d18b..7c13923 100644 --- a/test/Test/WaitStrategy.purs +++ b/test/Test/WaitStrategy.purs @@ -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