-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: allow oracle-free to use RemoteDockerImage constructor #10263
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
base: main
Are you sure you want to change the base?
feat: allow oracle-free to use RemoteDockerImage constructor #10263
Conversation
FYI - @eddumelendez |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @KyleAure, LGTM 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enables the Oracle Free container to be instantiated with a Future<String>
image (e.g., a remote Docker image), matching the superclass API and centralizing the waiting strategy in a shared method.
- Added a new
OracleContainer(Future<String> image)
constructor - Extracted
waitingFor
setup into a reusablepreconfigure()
method - Updated the existing
DockerImageName
constructor to callpreconfigure()
Comments suppressed due to low confidence (2)
modules/oracle-free/src/main/java/org/testcontainers/oracle/OracleContainer.java:67
- Please add JavaDoc for this constructor to explain its purpose and expected behavior when supplying a Future image.
public OracleContainer(Future<String> image) {
modules/oracle-free/src/main/java/org/testcontainers/oracle/OracleContainer.java:67
- There are no existing tests for this new constructor; please add unit tests that resolve the Future and verify the waiting strategy is applied correctly.
public OracleContainer(Future<String> image) {
@@ -64,9 +64,18 @@ public OracleContainer(String dockerImageName) { | |||
this(DockerImageName.parse(dockerImageName)); | |||
} | |||
|
|||
public OracleContainer(Future<String> image) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Future constructor does not enforce compatibility with DEFAULT_IMAGE_NAME. Consider parsing the resolved image into a DockerImageName and calling assertCompatibleWith(DEFAULT_IMAGE_NAME) to maintain consistent safety checks.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That comment is actually correct.
preconfigure(); | ||
} | ||
|
||
public OracleContainer(final DockerImageName dockerImageName) { | ||
super(dockerImageName); | ||
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); | ||
preconfigure(); | ||
} | ||
|
||
private void preconfigure() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The method name preconfigure
is generic; consider renaming it to something more descriptive, like applyDefaultWaitingStrategy
or configureStartupWait
for clarity.
preconfigure(); | |
} | |
public OracleContainer(final DockerImageName dockerImageName) { | |
super(dockerImageName); | |
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); | |
preconfigure(); | |
} | |
private void preconfigure() { | |
configureStartupWait(); | |
} | |
public OracleContainer(final DockerImageName dockerImageName) { | |
super(dockerImageName); | |
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME); | |
configureStartupWait(); | |
} | |
private void configureStartupWait() { |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we normally have this config in a protected void configure()
method.
Allow the Oracle Free container to leverage the use of a RemoteDockerImage by exposing an equivalent constructor as the JdbcDatabaseContainer superclass.