Skip to content

Commit

Permalink
Update integration tests to use Oracle container image 23.2.0-faststart
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne authored and DavideD committed Apr 5, 2023
1 parent 06674c8 commit 9cf94ce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,32 @@ 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.
// See https://github.com/gvenzl/oci-oracle-xe/issues/64
// 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() {
Expand Down
2 changes: 1 addition & 1 deletion podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit 9cf94ce

Please sign in to comment.