Skip to content

Commit 6ac2fa4

Browse files
committed
[#1546] Align and upgrade PostgreSQL images to 15.2
It was starting two different images for the tests
1 parent 0abf52d commit 6ac2fa4

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/containers/PostgreSQLDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class PostgreSQLDatabase implements TestableDatabase {
8282
* TIP: To reuse the same containers across multiple runs, set `testcontainers.reuse.enable=true` in a file located
8383
* at `$HOME/.testcontainers.properties` (create the file if it does not exist).
8484
*/
85-
public static final PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>( imageName( "postgres", "14.4" ) )
85+
public static final PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>( imageName( "postgres", "15.2" ) )
8686
.withUsername( DatabaseConfiguration.USERNAME )
8787
.withPassword( DatabaseConfiguration.PASSWORD )
8888
.withDatabaseName( DatabaseConfiguration.DB_NAME )

integration-tests/bytecode-enhancements-it/src/test/java/org/hibernate/reactive/it/BaseReactiveIT.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import io.vertx.ext.unit.junit.Timeout;
3939
import io.vertx.ext.unit.junit.VertxUnitRunner;
4040
import org.testcontainers.containers.PostgreSQLContainer;
41+
import org.testcontainers.utility.DockerImageName;
4142

4243
import static org.hibernate.reactive.util.impl.CompletionStages.loop;
4344
import static org.hibernate.reactive.util.impl.CompletionStages.voidFuture;
@@ -52,7 +53,10 @@ public abstract class BaseReactiveIT {
5253
// These properties are in DatabaseConfiguration in core
5354
public static final boolean USE_DOCKER = Boolean.getBoolean( "docker" );
5455

55-
public static final String IMAGE_NAME = "postgres:15.0";
56+
public static final DockerImageName IMAGE_NAME = DockerImageName
57+
.parse( "docker.io/postgres:15.2" )
58+
.asCompatibleSubstituteFor( "postgres" );
59+
5660
public static final String USERNAME = "hreact";
5761
public static final String PASSWORD = "hreact";
5862
public static final String DB_NAME = "hreact";
@@ -64,11 +68,11 @@ public abstract class BaseReactiveIT {
6468
.withReuse( true );
6569

6670
@ClassRule
67-
public static Timeout rule = Timeout.seconds( 10 * 60 );
71+
public static final Timeout rule = Timeout.seconds( 10 * 60 );
6872

6973
private static SessionFactory ormSessionFactory;
7074
@ClassRule
71-
public static RunTestOnContext vertxContextRule = new RunTestOnContext( () -> {
75+
public static final RunTestOnContext vertxContextRule = new RunTestOnContext( () -> {
7276
VertxOptions options = new VertxOptions();
7377
options.setBlockedThreadCheckInterval( 5 );
7478
options.setBlockedThreadCheckIntervalUnit( TimeUnit.MINUTES );

podman.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ required credentials and schema to run the tests:
3838
```
3939
podman run --rm --name HibernateTestingPGSQL \
4040
-e POSTGRES_USER=hreact -e POSTGRES_PASSWORD=hreact -e POSTGRES_DB=hreact \
41-
-p 5432:5432 postgres:15.0
41+
-p 5432:5432 postgres:15.2
4242
```
4343

4444
When the database has started, you can run the tests on PostgreSQL with:

tooling/jbang/PostgreSQLReactiveTest.java.qute

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class {baseName} {
6767
}
6868

6969
@ClassRule
70-
public final static PostgreSQLContainer database = new PostgreSQLContainer( imageName( "docker.io", "postgres", "15.0" ) );
70+
public final static PostgreSQLContainer database = new PostgreSQLContainer( imageName( "docker.io", "postgres", "15.2" ) );
7171

7272
private Mutiny.SessionFactory sessionFactory;
7373

tooling/jbang/ReactiveTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public String toString() {
228228
* It's a wrapper around the testcontainers classes.
229229
*/
230230
enum Database {
231-
POSTGRESQL( () -> new PostgreSQLContainer( "postgres:14" ) ),
231+
POSTGRESQL( () -> new PostgreSQLContainer( "postgres:15.2" ) ),
232232
MYSQL( () -> new MySQLContainer( "mysql:8.0.32" ) ),
233233
DB2( () -> new Db2Container( "docker.io/ibmcom/db2:11.5.8.0" ).acceptLicense() ),
234234
MARIADB( () -> new MariaDBContainer( "mariadb:10.11.2" ) ),

0 commit comments

Comments
 (0)