Skip to content

[2.4] Upgrade database dependencies for testing #2264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CockroachDBDatabase extends PostgreSQLDatabase {
* TIP: To reuse the same containers across multiple runs, set `testcontainers.reuse.enable=true` in a file located
* at `$HOME/.testcontainers.properties` (create the file if it does not exist).
*/
public static final CockroachContainer cockroachDb = new CockroachContainer( imageName( "cockroachdb/cockroach", "v24.1.15" ) )
public static final CockroachContainer cockroachDb = new CockroachContainer( imageName( "cockroachdb/cockroach", "v24.3.13" ) )
// Username, password and database are not supported by test container at the moment
// Testcontainers will use a database named 'postgres' and the 'root' user
.withReuse( true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class PostgreSQLDatabase implements TestableDatabase {
* TIP: To reuse the same containers across multiple runs, set `testcontainers.reuse.enable=true` in a file located
* at `$HOME/.testcontainers.properties` (create the file if it does not exist).
*/
public static final PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>( imageName( "postgres", "17.4" ) )
public static final PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>( imageName( "postgres", "17.5" ) )
.withUsername( DatabaseConfiguration.USERNAME )
.withPassword( DatabaseConfiguration.PASSWORD )
.withDatabaseName( DatabaseConfiguration.DB_NAME )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public abstract class BaseReactiveIT {
public static final boolean USE_DOCKER = Boolean.getBoolean( "docker" );

public static final DockerImageName IMAGE_NAME = DockerImageName
.parse( "docker.io/postgres:17.4" )
.parse( "docker.io/postgres:17.5" )
.asCompatibleSubstituteFor( "postgres" );

public static final String USERNAME = "hreact";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public abstract class BaseReactiveIT {
public static final boolean USE_DOCKER = Boolean.getBoolean( "docker" );

public static final DockerImageName IMAGE_NAME = DockerImageName
.parse( "docker.io/postgres:17.4" )
.parse( "docker.io/postgres:17.5" )
.asCompatibleSubstituteFor( "postgres" );

public static final String USERNAME = "hreact";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class VertxServer {
// These properties are in DatabaseConfiguration in core
public static final boolean USE_DOCKER = Boolean.getBoolean( "docker" );

public static final String IMAGE_NAME = "postgres:17.4";
public static final String IMAGE_NAME = "postgres:17.5";
public static final String USERNAME = "hreact";
public static final String PASSWORD = "hreact";
public static final String DB_NAME = "hreact";
Expand Down
8 changes: 4 additions & 4 deletions podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ If you replace `podman` with `sudo docker`, they will also work with [Docker][do
Example:

```
podman run --rm --name HibernateTestingPGSQL postgres:14.0
podman run --rm --name HibernateTestingPGSQL postgres:17.5
```

becomes for Docker:

```
sudo docker run --rm --name HibernateTestingPGSQL postgres:14.0
sudo docker run --rm --name HibernateTestingPGSQL postgres:17.5
```
---

Expand All @@ -39,7 +39,7 @@ required credentials and schema to run the tests:
podman run --rm --name HibernateTestingPGSQL \
-e POSTGRES_USER=hreact -e POSTGRES_PASSWORD=hreact -e POSTGRES_DB=hreact \
-e POSTGRES_INITDB_ARGS="-A password" \
-p 5432:5432 docker.io/postgres:17.4
-p 5432:5432 docker.io/postgres:17.5
```

When the database has started, you can run the tests on PostgreSQL with:
Expand Down Expand Up @@ -121,7 +121,7 @@ configured to run the tests:
```
podman run --rm --name=HibernateTestingCockroachDB \
--hostname=roachrr1 -p 26257:26257 -p 8080:8080 \
docker.io/cockroachdb/cockroach:v24.1.15 start-single-node --insecure
docker.io/cockroachdb/cockroach:v24.3.13 start-single-node --insecure
```

Some of tests needs temporary tables and because this is an experimental feature in
Expand Down
2 changes: 1 addition & 1 deletion tooling/jbang/CockroachDBReactiveTest.java.qute
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class {baseName} {
}

@ClassRule
public final static CockroachContainer database = new CockroachContainer( imageName( "cockroachdb", "cockroach", "v24.1.15" ) );
public final static CockroachContainer database = new CockroachContainer( imageName( "cockroachdb", "cockroach", "v24.3.13" ) );

private Mutiny.SessionFactory sessionFactory;

Expand Down
2 changes: 1 addition & 1 deletion tooling/jbang/Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* <pre>
* podman run --rm --name HibernateTestingPGSQL \
* -e POSTGRES_USER=hreact -e POSTGRES_PASSWORD=hreact -e POSTGRES_DB=hreact \
* -p 5432:5432 postgres:17.4
* -p 5432:5432 postgres:17.5
* </pre>
* </dd>
* <dt>3. Run the example with JBang</dt>
Expand Down
2 changes: 1 addition & 1 deletion tooling/jbang/PostgreSQLReactiveTest.java.qute
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class {baseName} {
}

@ClassRule
public final static PostgreSQLContainer database = new PostgreSQLContainer( imageName( "docker.io", "postgres", "17.4" ) );
public final static PostgreSQLContainer database = new PostgreSQLContainer( imageName( "docker.io", "postgres", "17.5" ) );

private Mutiny.SessionFactory sessionFactory;

Expand Down
4 changes: 2 additions & 2 deletions tooling/jbang/ReactiveTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ public String toString() {
* It's a wrapper around the testcontainers classes.
*/
enum Database {
POSTGRESQL( () -> new PostgreSQLContainer( "postgres:17.4" ) ),
POSTGRESQL( () -> new PostgreSQLContainer( "postgres:17.5" ) ),
MYSQL( () -> new MySQLContainer( "mysql:9.2.0" ) ),
DB2( () -> new Db2Container( "docker.io/icr.io/db2_community/db2:12.1.0.0" ).acceptLicense() ),
MARIADB( () -> new MariaDBContainer( "mariadb:11.7.2" ) ),
COCKROACHDB( () -> new CockroachContainer( "cockroachdb/cockroach:v24.1.15" ) );
COCKROACHDB( () -> new CockroachContainer( "cockroachdb/cockroach:v24.3.13" ) );

private final Supplier<JdbcDatabaseContainer<?>> containerSupplier;

Expand Down
Loading