From 086334df5935496cc0a704d84bb15e7d87535eff Mon Sep 17 00:00:00 2001 From: Nikita Kovalev Date: Tue, 6 Aug 2024 21:23:50 +0200 Subject: [PATCH] upgrade zio-testcontainers to support docker compose V2 --- .../src/test/resources/docker-compose.yml | 38 +++++++++---------- .../test/scala/zio/redis/ClusterSpec.scala | 2 +- .../scala/zio/redis/IntegrationSpec.scala | 6 +-- project/Dependencies.scala | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/modules/redis-it/src/test/resources/docker-compose.yml b/modules/redis-it/src/test/resources/docker-compose.yml index eec55f5cf..023a2bbc7 100644 --- a/modules/redis-it/src/test/resources/docker-compose.yml +++ b/modules/redis-it/src/test/resources/docker-compose.yml @@ -1,56 +1,56 @@ version: "3.3" services: - single-node-0: + single-node0: image: bitnami/redis:7.2 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - single-node-1: + single-node1: image: bitnami/redis:7.2 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - cluster-node-0: + cluster-node0: image: bitnami/redis-cluster:7.2 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - - 'REDIS_NODES=cluster-node-0 cluster-node-1 cluster-node-2 cluster-node-3 cluster-node-4 cluster-node-5' + - 'REDIS_NODES=cluster-node0 cluster-node1 cluster-node2 cluster-node3 cluster-node4 cluster-node5' - cluster-node-1: + cluster-node1: image: bitnami/redis-cluster:7.2 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - - 'REDIS_NODES=cluster-node-0 cluster-node-1 cluster-node-2 cluster-node-3 cluster-node-4 cluster-node-5' + - 'REDIS_NODES=cluster-node0 cluster-node1 cluster-node2 cluster-node3 cluster-node4 cluster-node5' - cluster-node-2: + cluster-node2: image: bitnami/redis-cluster:7.2 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - - 'REDIS_NODES=cluster-node-0 cluster-node-1 cluster-node-2 cluster-node-3 cluster-node-4 cluster-node-5' + - 'REDIS_NODES=cluster-node0 cluster-node1 cluster-node2 cluster-node3 cluster-node4 cluster-node5' - cluster-node-3: + cluster-node3: image: bitnami/redis-cluster:7.2 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - - 'REDIS_NODES=cluster-node-0 cluster-node-1 cluster-node-2 cluster-node-3 cluster-node-4 cluster-node-5' + - 'REDIS_NODES=cluster-node0 cluster-node1 cluster-node2 cluster-node3 cluster-node4 cluster-node5' - cluster-node-4: + cluster-node4: image: bitnami/redis-cluster:7.2 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - - 'REDIS_NODES=cluster-node-0 cluster-node-1 cluster-node-2 cluster-node-3 cluster-node-4 cluster-node-5' + - 'REDIS_NODES=cluster-node0 cluster-node1 cluster-node2 cluster-node3 cluster-node4 cluster-node5' - cluster-node-5: + cluster-node5: image: bitnami/redis-cluster:7.2 depends_on: - - cluster-node-0 - - cluster-node-1 - - cluster-node-2 - - cluster-node-3 - - cluster-node-4 + - cluster-node0 + - cluster-node1 + - cluster-node2 + - cluster-node3 + - cluster-node4 environment: - 'ALLOW_EMPTY_PASSWORD=yes' - 'REDIS_CLUSTER_REPLICAS=1' - - 'REDIS_NODES=cluster-node-0 cluster-node-1 cluster-node-2 cluster-node-3 cluster-node-4 cluster-node-5' + - 'REDIS_NODES=cluster-node0 cluster-node1 cluster-node2 cluster-node3 cluster-node4 cluster-node5' - 'REDIS_CLUSTER_CREATOR=yes' diff --git a/modules/redis-it/src/test/scala/zio/redis/ClusterSpec.scala b/modules/redis-it/src/test/scala/zio/redis/ClusterSpec.scala index 6da95650c..bb04f883a 100644 --- a/modules/redis-it/src/test/scala/zio/redis/ClusterSpec.scala +++ b/modules/redis-it/src/test/scala/zio/redis/ClusterSpec.scala @@ -17,7 +17,7 @@ trait ClusterSpec extends IntegrationSpec { ZIO .foreach(0 to 5) { n => ZIO - .attempt(docker.getServiceHost(s"cluster-node-$n", port)) + .attempt(docker.getServiceHost(s"cluster-node$n", port)) .map(host => RedisUri(s"$host:$port")) } .orDie diff --git a/modules/redis-it/src/test/scala/zio/redis/IntegrationSpec.scala b/modules/redis-it/src/test/scala/zio/redis/IntegrationSpec.scala index fb0bcee3a..467a20c98 100644 --- a/modules/redis-it/src/test/scala/zio/redis/IntegrationSpec.scala +++ b/modules/redis-it/src/test/scala/zio/redis/IntegrationSpec.scala @@ -70,7 +70,7 @@ trait IntegrationSpec extends ZIOSpecDefault { object IntegrationSpec { final val ClusterExecutorUnsupported = "cluster executor not supported" - final val MasterNode = "cluster-node-5" - final val SingleNode0 = "single-node-0" - final val SingleNode1 = "single-node-1" + final val MasterNode = "cluster-node5" + final val SingleNode0 = "single-node0" + final val SingleNode1 = "single-node1" } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 21c18dff3..4101de7c5 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -11,7 +11,7 @@ object Dependencies { val ZioConfig = "4.0.2" val ZioJson = "0.6.2" val ZioSchema = "1.2.2" - val ZioTestContainers = "0.4.1" + val ZioTestContainers = "0.5.0" } lazy val Benchmarks =