From 7af381e4080211471db64ded09161f9aa8c9d4aa Mon Sep 17 00:00:00 2001 From: Belonogov Nikolay Date: Wed, 20 Dec 2023 12:42:52 +0300 Subject: [PATCH 1/2] Bump testcontainers-java-tarantool version to 1.2.0 - Bump testcontainers-java-tarantool version to 1.2.0 - Bump org.testcontainers:junit-jupiter version to 1.19.3 - CHANGELOG.md Closes #442 --- CHANGELOG.md | 4 ++++ pom.xml | 4 ++-- .../integration/CartridgeMixedInstancesContainer.java | 1 - .../driver/integration/ClusterDiscoveryIT.java | 4 ++-- .../driver/integration/SharedCartridgeContainer.java | 2 +- .../driver/integration/ssl/SslClientITEnterprise.java | 2 -- .../integration/ssl/SslClientMTlsITEnterprise.java | 1 - src/test/resources/cartridge/init.lua | 2 +- src/test/resources/cartridge/instances.yml | 10 +++++----- src/test/resources/cartridge/instances_mixed.yml | 6 +++--- src/test/resources/cartridge/testapp-scm-1.rockspec | 4 ++-- src/test/resources/cartridge/topology.lua | 10 +++++----- src/test/resources/cartridge/topology_mixed.lua | 6 +++--- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e528713db..ac2f8e6e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog ## [Unreleased] +### Internal and API changes + +- Bump org.testcontainers:junit-jupiter version to 1.19.3 ([#442](https://github.com/tarantool/cartridge-java/issues/442)) +- Bump testcontainers-java-tarantool version to 1.2.0 ([#442](https://github.com/tarantool/cartridge-java/issues/442)) ### Features diff --git a/pom.xml b/pom.xml index bed543361..3b1aaf20f 100644 --- a/pom.xml +++ b/pom.xml @@ -258,13 +258,13 @@ org.testcontainers junit-jupiter - 1.17.4 + 1.19.3 test io.tarantool testcontainers-java-tarantool - 1.0.1 + 1.2.0 test diff --git a/src/test/java/io/tarantool/driver/integration/CartridgeMixedInstancesContainer.java b/src/test/java/io/tarantool/driver/integration/CartridgeMixedInstancesContainer.java index 181baf066..63c60c8d7 100644 --- a/src/test/java/io/tarantool/driver/integration/CartridgeMixedInstancesContainer.java +++ b/src/test/java/io/tarantool/driver/integration/CartridgeMixedInstancesContainer.java @@ -23,7 +23,6 @@ abstract class CartridgeMixedInstancesContainer { "cartridge-java-test-mixed", "cartridge/instances_mixed.yml", "cartridge/topology_mixed.lua") - .withDirectoryBinding("cartridge") .withLogConsumer(new Slf4jLogConsumer(logger)) .waitingFor(Wait.forLogMessage(".*Listening HTTP on.*", 3)) .withStartupTimeout(Duration.ofMinutes(2)) diff --git a/src/test/java/io/tarantool/driver/integration/ClusterDiscoveryIT.java b/src/test/java/io/tarantool/driver/integration/ClusterDiscoveryIT.java index 17574eb03..e919989a5 100644 --- a/src/test/java/io/tarantool/driver/integration/ClusterDiscoveryIT.java +++ b/src/test/java/io/tarantool/driver/integration/ClusterDiscoveryIT.java @@ -31,8 +31,8 @@ */ public class ClusterDiscoveryIT extends SharedCartridgeContainer { - private static final String TEST_ROUTER1_URI = "localhost:3301"; - private static final String TEST_ROUTER2_URI = "localhost:3302"; + private static final String TEST_ROUTER1_URI = "0.0.0.0:3301"; + private static final String TEST_ROUTER2_URI = "0.0.0.0:3302"; @BeforeAll public static void setUp() { diff --git a/src/test/java/io/tarantool/driver/integration/SharedCartridgeContainer.java b/src/test/java/io/tarantool/driver/integration/SharedCartridgeContainer.java index b221498f0..16fc29190 100644 --- a/src/test/java/io/tarantool/driver/integration/SharedCartridgeContainer.java +++ b/src/test/java/io/tarantool/driver/integration/SharedCartridgeContainer.java @@ -21,7 +21,7 @@ public abstract class SharedCartridgeContainer { "cartridge-java-test", "cartridge/instances.yml", "cartridge/topology.lua") - .withDirectoryBinding("cartridge") + .withEnv("TARANTOOL_CLUSTER_COOKIE", "secret-cluster-cookie") .withLogConsumer(new Slf4jLogConsumer(logger)) .waitingFor(Wait.forLogMessage(".*Listening HTTP on.*", 4)) .withStartupTimeout(Duration.ofMinutes(2)); diff --git a/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java b/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java index 207e9450a..c5c8e58e7 100644 --- a/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java +++ b/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java @@ -56,7 +56,6 @@ public static void setUp() throws URISyntaxException, SSLException { .withUsername("test_user") .withPassword("test_password") .withMemtxMemory(256 * 1024 * 1024) - .withDirectoryBinding(RESOURCE_PATH + "ssl") .withLogConsumer(new Slf4jLogConsumer(log)) .withSslContext(org.testcontainers.containers.SslContext.getSslContext()); @@ -66,7 +65,6 @@ public static void setUp() throws URISyntaxException, SSLException { .withUsername("test_user") .withPassword("test_password") .withMemtxMemory(256 * 1024 * 1024) - .withDirectoryBinding(RESOURCE_PATH) .withLogConsumer(new Slf4jLogConsumer(log)); if (!containerWithSsl.isRunning()) { diff --git a/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java b/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java index 0b265710d..d0b570f8b 100644 --- a/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java +++ b/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java @@ -57,7 +57,6 @@ public static void setUp() throws Exception { .withUsername("test_user") .withPassword("test_password") .withMemtxMemory(256 * 1024 * 1024) - .withDirectoryBinding(RESOURCE_PATH) .withLogConsumer(new Slf4jLogConsumer(log)) .withSslContext(org.testcontainers.containers.SslContext.getSslContext( RESOURCE_PATH + "ca.key", diff --git a/src/test/resources/cartridge/init.lua b/src/test/resources/cartridge/init.lua index 37f6ae5c5..14d3aaf3f 100755 --- a/src/test/resources/cartridge/init.lua +++ b/src/test/resources/cartridge/init.lua @@ -16,7 +16,7 @@ local ok, err = cartridge.cfg({ 'app.roles.api_storage', 'app.roles.custom', }, - cluster_cookie = 'testapp-cluster-cookie', + cluster_cookie = 'secret-cluster-cookie', }, { readahead = 10 * 1024 * 1024, -- 10 MB net_msg_max = 11140, diff --git a/src/test/resources/cartridge/instances.yml b/src/test/resources/cartridge/instances.yml index 2a802a6dd..61fc155f7 100644 --- a/src/test/resources/cartridge/instances.yml +++ b/src/test/resources/cartridge/instances.yml @@ -1,24 +1,24 @@ testapp.router: workdir: ./tmp/db_dev/3301 - advertise_uri: localhost:3301 + advertise_uri: 0.0.0.0:3301 http_port: 8081 testapp.second-router: workdir: ./tmp/db_dev/3302 - advertise_uri: localhost:3302 + advertise_uri: 0.0.0.0:3302 http_port: 8082 testapp.third-router: workdir: ./tmp/db_dev/3303 - advertise_uri: localhost:3303 + advertise_uri: 0.0.0.0:3303 http_port: 8083 testapp.s1-storage: workdir: ./tmp/db_dev/3304 - advertise_uri: localhost:3304 + advertise_uri: 0.0.0.0:3304 http_port: 8084 testapp.s2-storage: workdir: ./tmp/db_dev/3305 - advertise_uri: localhost:3305 + advertise_uri: 0.0.0.0:3305 http_port: 8085 diff --git a/src/test/resources/cartridge/instances_mixed.yml b/src/test/resources/cartridge/instances_mixed.yml index d707b288f..b4608219d 100644 --- a/src/test/resources/cartridge/instances_mixed.yml +++ b/src/test/resources/cartridge/instances_mixed.yml @@ -1,14 +1,14 @@ testapp.1: workdir: ./tmp/db_dev/3301 - advertise_uri: localhost:3301 + advertise_uri: 0.0.0.0:3301 http_port: 8081 testapp.2: workdir: ./tmp/db_dev/3302 - advertise_uri: localhost:3302 + advertise_uri: 0.0.0.0:3302 http_port: 8082 testapp.3: workdir: ./tmp/db_dev/3303 - advertise_uri: localhost:3303 + advertise_uri: 0.0.0.0:3303 http_port: 8083 diff --git a/src/test/resources/cartridge/testapp-scm-1.rockspec b/src/test/resources/cartridge/testapp-scm-1.rockspec index d8e901944..3b897e823 100644 --- a/src/test/resources/cartridge/testapp-scm-1.rockspec +++ b/src/test/resources/cartridge/testapp-scm-1.rockspec @@ -7,8 +7,8 @@ source = { dependencies = { 'tarantool', 'lua >= 5.1', - 'cartridge == 2.7.3-1', - 'crud == 0.14.0-1', + 'cartridge == 2.8.3-1', + 'crud == 1.3.0-1', } build = { type = 'none'; diff --git a/src/test/resources/cartridge/topology.lua b/src/test/resources/cartridge/topology.lua index 65d06d238..ba9eaedd7 100644 --- a/src/test/resources/cartridge/topology.lua +++ b/src/test/resources/cartridge/topology.lua @@ -2,23 +2,23 @@ cartridge = require('cartridge') replicasets = { { alias = 'app-router', roles = { 'vshard-router', 'app.roles.custom', 'app.roles.api_router' }, - join_servers = { { uri = 'localhost:3301' } } + join_servers = { { uri = '0.0.0.0:3301' } } }, { alias = 'app-router-second', roles = { 'vshard-router', 'app.roles.custom', 'app.roles.api_router' }, - join_servers = { { uri = 'localhost:3302' } } + join_servers = { { uri = '0.0.0.0:3302' } } }, { alias = 'app-router-third', roles = { 'vshard-router', 'app.roles.custom', 'app.roles.api_router' }, - join_servers = { { uri = 'localhost:3303' } } + join_servers = { { uri = '0.0.0.0:3303' } } }, { alias = 's1-storage', roles = { 'vshard-storage', 'app.roles.api_storage' }, - join_servers = { { uri = 'localhost:3304' } } + join_servers = { { uri = '0.0.0.0:3304' } } }, { alias = 's2-storage', roles = { 'vshard-storage', 'app.roles.api_storage' }, - join_servers = { { uri = 'localhost:3305' } } + join_servers = { { uri = '0.0.0.0:3305' } } } } return cartridge.admin_edit_topology({ replicasets = replicasets }) diff --git a/src/test/resources/cartridge/topology_mixed.lua b/src/test/resources/cartridge/topology_mixed.lua index 9e8e0ebc0..05dbed101 100644 --- a/src/test/resources/cartridge/topology_mixed.lua +++ b/src/test/resources/cartridge/topology_mixed.lua @@ -3,9 +3,9 @@ replicasets = { { alias = 'mixed-replicasets', roles = { 'vshard-router', 'app.roles.api_router', 'vshard-storage', 'app.roles.api_storage', 'app.roles.custom' }, join_servers = { - { uri = 'localhost:3301' }, - { uri = 'localhost:3302' }, - { uri = 'localhost:3303' }, + { uri = '0.0.0.0:3301' }, + { uri = '0.0.0.0:3302' }, + { uri = '0.0.0.0:3303' }, } } } return cartridge.admin_edit_topology({ replicasets = replicasets }) From 3aa7892511133938d2d41a41357b4d8deec4af27 Mon Sep 17 00:00:00 2001 From: Belonogov Nikolay Date: Wed, 20 Dec 2023 22:28:12 +0300 Subject: [PATCH 2/2] Fix after review Closes #442 --- .../driver/integration/ssl/SslClientITEnterprise.java | 2 ++ .../driver/integration/ssl/SslClientMTlsITEnterprise.java | 1 + src/test/resources/cartridge/init.lua | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java b/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java index c5c8e58e7..207e9450a 100644 --- a/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java +++ b/src/test/java/io/tarantool/driver/integration/ssl/SslClientITEnterprise.java @@ -56,6 +56,7 @@ public static void setUp() throws URISyntaxException, SSLException { .withUsername("test_user") .withPassword("test_password") .withMemtxMemory(256 * 1024 * 1024) + .withDirectoryBinding(RESOURCE_PATH + "ssl") .withLogConsumer(new Slf4jLogConsumer(log)) .withSslContext(org.testcontainers.containers.SslContext.getSslContext()); @@ -65,6 +66,7 @@ public static void setUp() throws URISyntaxException, SSLException { .withUsername("test_user") .withPassword("test_password") .withMemtxMemory(256 * 1024 * 1024) + .withDirectoryBinding(RESOURCE_PATH) .withLogConsumer(new Slf4jLogConsumer(log)); if (!containerWithSsl.isRunning()) { diff --git a/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java b/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java index d0b570f8b..0b265710d 100644 --- a/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java +++ b/src/test/java/io/tarantool/driver/integration/ssl/SslClientMTlsITEnterprise.java @@ -57,6 +57,7 @@ public static void setUp() throws Exception { .withUsername("test_user") .withPassword("test_password") .withMemtxMemory(256 * 1024 * 1024) + .withDirectoryBinding(RESOURCE_PATH) .withLogConsumer(new Slf4jLogConsumer(log)) .withSslContext(org.testcontainers.containers.SslContext.getSslContext( RESOURCE_PATH + "ca.key", diff --git a/src/test/resources/cartridge/init.lua b/src/test/resources/cartridge/init.lua index 14d3aaf3f..89981f4b9 100755 --- a/src/test/resources/cartridge/init.lua +++ b/src/test/resources/cartridge/init.lua @@ -15,8 +15,7 @@ local ok, err = cartridge.cfg({ 'app.roles.api_router', 'app.roles.api_storage', 'app.roles.custom', - }, - cluster_cookie = 'secret-cluster-cookie', + } }, { readahead = 10 * 1024 * 1024, -- 10 MB net_msg_max = 11140,