Skip to content
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

Update integration tests to use Oracle container image 23.2.0-faststart #1561

Merged
merged 1 commit into from
Apr 5, 2023
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 @@ -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
```