From 0a522dad7a93f59da28f701017316f537c25af70 Mon Sep 17 00:00:00 2001 From: Sanne Grinovero Date: Wed, 5 Apr 2023 11:20:10 +0100 Subject: [PATCH] Update integration tests to use Oracle container image 23.2.0-faststart --- .../reactive/containers/OracleDatabase.java | 17 +++++++++++++++-- podman.md | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/containers/OracleDatabase.java b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/containers/OracleDatabase.java index 05cdaae63..a2b53658b 100644 --- a/hibernate-reactive-core/src/test/java/org/hibernate/reactive/containers/OracleDatabase.java +++ b/hibernate-reactive-core/src/test/java/org/hibernate/reactive/containers/OracleDatabase.java @@ -84,12 +84,15 @@ class OracleDatabase implements TestableDatabase { } } - public static final OracleContainer oracle = new OracleContainer( imageName( "gvenzl/oracle-xe", "21-slim-faststart" ) ) + public static final OracleContainer oracle = new OracleContainer( + imageName( "gvenzl/oracle-free", "23.2.0-faststart" ) + .asCompatibleSubstituteFor( "gvenzl/oracle-xe" ) ) .withUsername( DatabaseConfiguration.USERNAME ) .withPassword( DatabaseConfiguration.PASSWORD ) .withDatabaseName( DatabaseConfiguration.DB_NAME ) - .withLogConsumer( of -> System.out.println( of.getUtf8String() ) ) + .withLogConsumer( of -> logContainerOutput( of.getUtf8String() ) ) .withReuse( true ) + .withStartupAttempts( 1 ) // We need to limit the maximum amount of CPUs being used by the container; // otherwise the hardcoded memory configuration of the DB might not be enough to successfully boot it. @@ -97,6 +100,16 @@ class OracleDatabase implements TestableDatabase { // I choose to limit it to "2 cpus": should be more than enough for any local testing needs, // and keeps things simple. .withCreateContainerCmdModifier( cmd -> cmd.getHostConfig().withCpuCount( 2L ) ); + ; + + private static void logContainerOutput(String line) { + System.out.print( line ); + } + + //Start the container only - useful for testing and CLI + public static void main(String[] args) { + oracle.start(); + } @Override public String getJdbcUrl() { diff --git a/podman.md b/podman.md index bbec3ca93..ebe56f54b 100644 --- a/podman.md +++ b/podman.md @@ -206,5 +206,5 @@ and schema to run the tests: [oracle]:https://www.oracle.com/database/technologies/appdev/xe.html ``` -podman run --rm --name HibernateTestingOracle -e ORACLE_PASSWORD=hreact -e APP_USER=hreact -e APP_USER_PASSWORD=hreact -e ORACLE_DATABASE=hreact -p 1521:1521 docker.io/gvenzl/oracle-xe:21-slim-faststart +podman run --rm --name HibernateTestingOracle -e ORACLE_PASSWORD=hreact -e APP_USER=hreact -e APP_USER_PASSWORD=hreact -e ORACLE_DATABASE=hreact -p 1521:1521 docker.io/gvenzl/oracle-free:23.2.0-faststart ```