Skip to content

Commit 57fb7f7

Browse files
authored
Modernize database version testing matrix (#1657)
* Modernize database version testing matrix Closes #1645 Update CI and test infrastructure to use currently supported database versions: - PostgreSQL: 14, 16, 18 (was 9, 10, 11) - MySQL: 8.4 LTS, 9.6 (was 5.6, 5.7, 8.0) - MariaDB: 11.8 LTS (was 10.4) - MSSQL: 2019, 2022, 2025 (was 2017, 2019, 2025) - Oracle: 23-slim-faststart (was 23.3-slim-faststart) - DB2: 12.1 (unchanged) JDK 11 tests baseline version per database (7 jobs) JDK 25 tests multiple versions comprehensively (11 jobs) Removed version-specific workarounds for EOL databases and updated PostgreSQL test SSL certificates to 2048-bit for compatibility with PostgreSQL 14+. Some portions of this content were created with the assistance of IBM Bob. Some portions of this content were created with the assistance of Claude Code. Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Fix and simplify MSSQLRule - Fix the list of supported versions - All the sqlcmd paths and wait strategies are now the same Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Fix MySQLRule for MariaDB 11.8 caching-sha2-password-public-key-path and caching-sha2-password-private-key-path are MySQL specific now. Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Minor, extract method Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Make force_ssl.sh more robust Starting with PG 18, PGDATA points to /var/lib/postgresql/MAJOR/docker docker-library/postgres#1259 Using the environment variable, the script works with all DB versions. Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Switch to scram-sha-256 in pgbouncer.ini In Postgres 14+, the default password encryption is scram-sha-256, not md5. Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Improve MySQL rule Add container fixed port sysprop for easy debugging with Wireshark Set a container wait strategy to make sure the DB is ready for connections Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Disable SSL when not needed in MySQL client tests By default, the MySQL Client prefers SSL if available on the server. But since we have a self-signed certificate for testing, the client does not accept it. Therefore, it fallbacks to no SSL and creates two connections in total. That is why a couple metrics test fail, because the test expect only one connection to be closed. Signed-off-by: Thomas Segismont <tsegismont@gmail.com> * Skip TIME overflow tests for MySQL 9.6 Starting with MySQL 9.5, overflow is reported as an error Signed-off-by: Thomas Segismont <tsegismont@gmail.com> --------- Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 3015aaa commit 57fb7f7

File tree

34 files changed

+334
-355
lines changed

34 files changed

+334
-355
lines changed

.github/workflows/ci-matrix-5.x.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,68 +11,67 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
include:
14+
# JDK 11 - Baseline (7 jobs)
1415
- os: ubuntu-latest
1516
jdk: 11
16-
profile: 'PostgreSQL-9'
17+
profile: 'PostgreSQL-14'
1718
module: 'vertx-pg-client'
1819
- os: ubuntu-latest
1920
jdk: 11
20-
profile: 'PostgreSQL-10'
21-
module: 'vertx-pg-client'
22-
- os: ubuntu-latest
23-
jdk: 11
24-
profile: 'PostgreSQL-11'
25-
module: 'vertx-pg-client'
26-
- os: ubuntu-latest
27-
jdk: 11
28-
profile: 'MySQL-8.0'
29-
module: 'vertx-mysql-client'
30-
- os: ubuntu-latest
31-
jdk: 11
32-
profile: 'MySQL-5.6'
21+
profile: 'MySQL-8.4'
3322
module: 'vertx-mysql-client'
3423
- os: ubuntu-latest
3524
jdk: 11
36-
profile: 'MySQL-5.7'
25+
profile: 'MariaDB-11.8'
3726
module: 'vertx-mysql-client'
38-
- os: ubuntu-latest
39-
jdk: 11
40-
profile: 'MariaDB-10.4'
41-
module: 'vertx-mysql-client'
42-
- os: ubuntu-latest
43-
jdk: 11
44-
profile: 'MSSQL-2017-latest'
45-
module: 'vertx-mssql-client'
4627
- os: ubuntu-latest
4728
jdk: 11
4829
profile: 'MSSQL-2019-latest'
4930
module: 'vertx-mssql-client'
5031
- os: ubuntu-latest
5132
jdk: 11
52-
profile: 'MSSQL-2025-latest'
53-
module: 'vertx-mssql-client'
33+
profile: 'DB2-12.1'
34+
module: 'vertx-db2-client'
5435
- os: ubuntu-latest
5536
jdk: 11
56-
module: 'vertx-db2-client'
37+
profile: 'Oracle-23'
38+
module: 'vertx-oracle-client'
5739
- os: ubuntu-latest
5840
jdk: 11
5941
module: 'vertx-sql-client-templates'
42+
# JDK 25 - Comprehensive (11 jobs)
43+
- os: ubuntu-latest
44+
jdk: 25
45+
profile: 'PostgreSQL-14'
46+
module: 'vertx-pg-client'
47+
- os: ubuntu-latest
48+
jdk: 25
49+
profile: 'PostgreSQL-16'
50+
module: 'vertx-pg-client'
6051
- os: ubuntu-latest
6152
jdk: 25
62-
profile: 'PostgreSQL-11'
53+
profile: 'PostgreSQL-18'
6354
module: 'vertx-pg-client'
6455
- os: ubuntu-latest
6556
jdk: 25
66-
profile: 'MySQL-5.7'
57+
profile: 'MySQL-8.4'
58+
module: 'vertx-mysql-client'
59+
- os: ubuntu-latest
60+
jdk: 25
61+
profile: 'MySQL-9.6'
6762
module: 'vertx-mysql-client'
6863
- os: ubuntu-latest
6964
jdk: 25
70-
profile: 'MariaDB-10.4'
65+
profile: 'MariaDB-11.8'
7166
module: 'vertx-mysql-client'
7267
- os: ubuntu-latest
7368
jdk: 25
7469
profile: 'MSSQL-2019-latest'
7570
module: 'vertx-mssql-client'
71+
- os: ubuntu-latest
72+
jdk: 25
73+
profile: 'MSSQL-2022-latest'
74+
module: 'vertx-mssql-client'
7675
- os: ubuntu-latest
7776
jdk: 25
7877
profile: 'MSSQL-2025-latest'

vertx-db2-client/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
<description>The Reactive DB2 client</description>
2727

2828
<properties>
29+
<!-- Set to a value for testing with a specific database version -->
30+
<db2-container.version/>
2931
<vertx.asciidoc.sources.dir>${project.basedir}/src/main/asciidoc/*.adoc,${project.basedir}/../vertx-sql-client/src/main/asciidoc/*.adoc</vertx.asciidoc.sources.dir>
3032
<vertx.surefire.useModulePath>false</vertx.surefire.useModulePath>
3133
</properties>
@@ -100,6 +102,7 @@
100102
<trimStackTrace>false</trimStackTrace>
101103
<systemPropertyVariables>
102104
<target.dir>${project.build.directory}</target.dir>
105+
<db2-container.version>${db2-container.version}</db2-container.version>
103106
<!-- Copy of java.security that allows TLS 1.1 as the DB2 container will only accept this version
104107
(https://bugs.openjdk.java.net/browse/JDK-8258598) -->
105108
<java.security.properties>${project.basedir}/src/test/java.security</java.security.properties>
@@ -125,4 +128,13 @@
125128
</plugins>
126129
</build>
127130

131+
<profiles>
132+
<profile>
133+
<id>DB2-12.1</id>
134+
<properties>
135+
<db2-container.version>12.1.4.0</db2-container.version>
136+
</properties>
137+
</profile>
138+
</profiles>
139+
128140
</project>

vertx-db2-client/src/test/java/io/vertx/tests/db2client/junit/DB2Resource.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ public class DB2Resource extends ExternalResource {
3030
private static final Logger logger = LoggerFactory.getLogger(DB2Resource.class);
3131

3232
private static final boolean CUSTOM_DB2 = get("DB2_HOST") != null;
33+
private static final String CONTAINER_VERSION = get("db2-container.version", "12.1.4.0");
3334

3435
public static final DB2Resource SHARED_INSTANCE = new DB2Resource();
3536

3637
private boolean started = false;
3738
private DB2ConnectOptions options;
38-
private final GenericContainer instance = new GenericContainer<>("icr.io/db2_community/db2:12.1.4.0")
39+
private final GenericContainer instance = new GenericContainer<>("icr.io/db2_community/db2:" + CONTAINER_VERSION)
3940
.withCreateContainerCmdModifier(cmd -> cmd
4041
.withCapAdd(Capability.IPC_LOCK)
4142
.withCapAdd(Capability.IPC_OWNER))
@@ -114,4 +115,9 @@ private static String get(String name) {
114115
return System.getProperty(name, System.getenv(name));
115116
}
116117

118+
private static String get(String name, String defaultValue) {
119+
String value = System.getProperty(name, System.getenv(name));
120+
return value != null && !value.isEmpty() ? value : defaultValue;
121+
}
122+
117123
}

vertx-mssql-client/README.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ You can test with different SQL Server versions by using Maven profiles:
2424

2525
[source,bash]
2626
----
27-
mvn test -P MSSQL-2017-latest
2827
mvn test -P MSSQL-2019-latest
28+
mvn test -P MSSQL-2022-latest
2929
mvn test -P MSSQL-2025-latest
3030
----
3131

3232
Or by passing the version property directly:
3333

3434
[source,bash]
3535
----
36-
mvn test -Dmssql-container.version=2017-latest
36+
mvn test -Dmssql-container.version=2019-latest
3737
----
3838

3939
The following versions are supported:
4040

41-
* `2017-latest`
4241
* `2019-latest`
42+
* `2022-latest`
4343
* `2025-latest` (default)
4444

4545
==== Testing with an external database

vertx-mssql-client/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@
8888

8989
<profiles>
9090
<profile>
91-
<id>MSSQL-2017-latest</id>
91+
<id>MSSQL-2019-latest</id>
9292
<properties>
93-
<mssql-container.version>2017-latest</mssql-container.version>
93+
<mssql-container.version>2019-latest</mssql-container.version>
9494
</properties>
9595
</profile>
9696
<profile>
97-
<id>MSSQL-2019-latest</id>
97+
<id>MSSQL-2022-latest</id>
9898
<properties>
99-
<mssql-container.version>2019-latest</mssql-container.version>
99+
<mssql-container.version>2022-latest</mssql-container.version>
100100
</properties>
101101
</profile>
102102
<profile>

vertx-mssql-client/src/test/java/io/vertx/tests/mssqlclient/junit/MSSQLRule.java

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.testcontainers.containers.GenericContainer;
1919
import org.testcontainers.containers.InternetProtocol;
2020
import org.testcontainers.containers.wait.strategy.Wait;
21-
import org.testcontainers.containers.wait.strategy.WaitStrategy;
2221

2322
import java.io.IOException;
2423
import java.util.Objects;
@@ -46,35 +45,14 @@ public enum Config {
4645
}
4746

4847
private enum ServerVersion {
49-
MSSQL_2017("2017-latest", "/opt/mssql-tools/bin/sqlcmd", false,
50-
Wait.forLogMessage(".*SQL Server is now ready for client connections.*\\n", 1)),
51-
MSSQL_2019("2019-latest", "/opt/mssql-tools18/bin/sqlcmd", true,
52-
Wait.forLogMessage(".*The tempdb database has \\d+ data file\\(s\\).*\\n", 2)),
53-
MSSQL_2025("2025-latest", "/opt/mssql-tools18/bin/sqlcmd", true,
54-
Wait.forLogMessage(".*The tempdb database has \\d+ data file\\(s\\).*\\n", 2));
48+
MSSQL_2019("2019-latest"),
49+
MSSQL_2022("2022-latest"),
50+
MSSQL_2025("2025-latest");
5551

5652
private final String dockerImageTag;
57-
private final String sqlcmdPath;
58-
private final boolean supportsTrustServerCertificate;
59-
private final WaitStrategy waitStrategy;
6053

61-
ServerVersion(String dockerImageTag, String sqlcmdPath, boolean supportsTrustServerCertificate, WaitStrategy waitStrategy) {
54+
ServerVersion(String dockerImageTag) {
6255
this.dockerImageTag = dockerImageTag;
63-
this.sqlcmdPath = sqlcmdPath;
64-
this.supportsTrustServerCertificate = supportsTrustServerCertificate;
65-
this.waitStrategy = waitStrategy;
66-
}
67-
68-
String getSqlcmdPath() {
69-
return sqlcmdPath;
70-
}
71-
72-
boolean supportsTrustServerCertificate() {
73-
return supportsTrustServerCertificate;
74-
}
75-
76-
WaitStrategy getWaitStrategy() {
77-
return waitStrategy;
7856
}
7957

8058
boolean supportsConfig(Config config) {
@@ -87,10 +65,10 @@ static ServerVersion fromDockerTag(String dockerImageTag) {
8765
return MSSQL_2025;
8866
}
8967
switch (dockerImageTag) {
90-
case "2017-latest":
91-
return MSSQL_2017;
9268
case "2019-latest":
9369
return MSSQL_2019;
70+
case "2022-latest":
71+
return MSSQL_2022;
9472
case "2025-latest":
9573
return MSSQL_2025;
9674
default:
@@ -160,7 +138,7 @@ private MSSQLConnectOptions startMSSQL() throws IOException {
160138
.withEnv("TZ", "UTC")
161139
.withEnv("SA_PASSWORD", PASSWORD)
162140
.withClasspathResourceMapping("init.sql", INIT_SQL, READ_ONLY)
163-
.waitingFor(serverVersion.getWaitStrategy());
141+
.waitingFor(Wait.forLogMessage(".*The tempdb database has \\d+ data file\\(s\\).*\\n", 2));
164142

165143
if (System.getProperties().containsKey("containerFixedPort")) {
166144
server.withFixedExposedPort(DEFAULT_PORT, DEFAULT_PORT);
@@ -209,20 +187,18 @@ private void initDb() throws IOException {
209187

210188
private String[] cmdArgs() {
211189
Stream.Builder<String> builder = Stream.builder();
212-
builder.add(serverVersion.getSqlcmdPath());
190+
builder.add("/opt/mssql-tools18/bin/sqlcmd");
213191
builder.add("-S").add("localhost");
214192
builder.add("-U").add(USER);
215193
builder.add("-P").add(PASSWORD);
216194
builder.add("-i").add(INIT_SQL);
217-
if (serverVersion.supportsTrustServerCertificate()) {
218-
if (config == Config.STRICT_ENCRYPTION) {
219-
builder.add("-Ns");
220-
builder.add("-J").add("/etc/ssl/certs/mssql.pem");
221-
builder.add("-F").add("sql1");
222-
} else {
223-
builder.add("-C");
224-
builder.add("-No");
225-
}
195+
if (config == Config.STRICT_ENCRYPTION) {
196+
builder.add("-Ns");
197+
builder.add("-J").add("/etc/ssl/certs/mssql.pem");
198+
builder.add("-F").add("sql1");
199+
} else {
200+
builder.add("-C");
201+
builder.add("-No");
226202
}
227203
return builder.build().toArray(String[]::new);
228204
}

vertx-mysql-client/README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ If the database server is not specified, then `MySQL` will be used by default.
2626
You can also change the version of the database by passing an optional Docker tag named `testing.mysql.database.version` like this:
2727

2828
```
29-
> mvn test -Dtesting.mysql.database.version=5.6.45
29+
> mvn test -Dtesting.mysql.database.version=8.4
3030
```
3131

32-
If the database version is not specified, then `5.7` will be used by default for MySQL while `10.4` will be used by default for MariaDB.
32+
If the database version is not specified, then `8.4` will be used by default for MySQL while `11.8` will be used by default for MariaDB.
3333

3434
=== Testing with an external database
3535

vertx-mysql-client/docker/mysql/docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ version: "3"
22

33
services:
44
test-mysql:
5-
image: mysql:8.0
6-
# image: mariadb:10.4
5+
image: mysql:8.4
76
ports:
87
- "3306:3306"
98
environment:
@@ -12,12 +11,11 @@ services:
1211
MYSQL_ROOT_PASSWORD: password
1312
MYSQL_DATABASE: testschema
1413
command: --max_allowed_packet=33554432 --max_prepared_stmt_count=16382 --local_infile=ON --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --caching-sha2-password-public-key-path=/etc/mysql/tls/public_key.pem --caching-sha2-password-private-key-path=/etc/mysql/tls/private_key.pem
15-
# note caching-sha2-password-public-key-path and caching-sha2-password-private-key-path are introduced in MySQL 8.0.3
1614
volumes:
1715
- ../../src/test/resources/init.sql:/docker-entrypoint-initdb.d/init.sql
1816
- ../../src/test/resources/tls/files:/etc/mysql/tls
1917
test-tls-mysql:
20-
image: mysql:8.0
18+
image: mysql:8.4
2119
ports:
2220
- "3307:3306"
2321
environment:

vertx-mysql-client/pom.xml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
<?xml version="1.0"?>
22
<!--
3-
~ Copyright (C) 2017 Julien Viet
3+
~ Copyright (c) 2011-2026 Contributors to the Eclipse Foundation
44
~
5-
~ Licensed under the Apache License, Version 2.0 (the "License");
6-
~ you may not use this file except in compliance with the License.
7-
~ You may obtain a copy of the License at
8-
~
9-
~ http://www.apache.org/licenses/LICENSE-2.0
10-
~
11-
~ Unless required by applicable law or agreed to in writing, software
12-
~ distributed under the License is distributed on an "AS IS" BASIS,
13-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
~ See the License for the specific language governing permissions and
15-
~ limitations under the License.
5+
~ This program and the accompanying materials are made available under the
6+
~ terms of the Eclipse Public License 2.0 which is available at
7+
~ http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
8+
~ which is available at https://www.apache.org/licenses/LICENSE-2.0.
169
~
10+
~ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
1711
-->
1812
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1913

@@ -91,31 +85,24 @@
9185

9286
<profiles>
9387
<profile>
94-
<id>MySQL-5.6</id>
95-
<properties>
96-
<testing.mysql.database.server>mysql</testing.mysql.database.server>
97-
<testing.mysql.database.version>5.6</testing.mysql.database.version>
98-
</properties>
99-
</profile>
100-
<profile>
101-
<id>MySQL-5.7</id>
88+
<id>MySQL-8.4</id>
10289
<properties>
10390
<testing.mysql.database.server>mysql</testing.mysql.database.server>
104-
<testing.mysql.database.version>5.7</testing.mysql.database.version>
91+
<testing.mysql.database.version>8.4</testing.mysql.database.version>
10592
</properties>
10693
</profile>
10794
<profile>
108-
<id>MySQL-8.0</id>
95+
<id>MySQL-9.6</id>
10996
<properties>
11097
<testing.mysql.database.server>mysql</testing.mysql.database.server>
111-
<testing.mysql.database.version>8.0</testing.mysql.database.version>
98+
<testing.mysql.database.version>9.6</testing.mysql.database.version>
11299
</properties>
113100
</profile>
114101
<profile>
115-
<id>MariaDB-10.4</id>
102+
<id>MariaDB-11.8</id>
116103
<properties>
117104
<testing.mysql.database.server>mariadb</testing.mysql.database.server>
118-
<testing.mysql.database.version>10.4</testing.mysql.database.version>
105+
<testing.mysql.database.version>11.8</testing.mysql.database.version>
119106
</properties>
120107
</profile>
121108
</profiles>

0 commit comments

Comments
 (0)