-
Notifications
You must be signed in to change notification settings - Fork 40.5k
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
Support tc datasource prefix for test containers #19044
Support tc datasource prefix for test containers #19044
Conversation
fef3237
to
8e529c8
Compare
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.
Thanks for the PR but I am but puzzled by the product name there.
/** | ||
* Testcontainers. | ||
*/ | ||
TESTCONTAINERS("Testcontainers", "org.testcontainers.jdbc.ContainerDatabaseDriver") { |
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.
is Testcontainers
the product name of this driver? The way I understood it was that it is a wrapper for the actual underlying database container
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.
FYI the driver does not return a product name property from getPropertyInfo
.
I would highly recommend to write a test that checks it with the TC's driver (no need to start a container, just the lookup part), especially given that it is already on classpath
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.
Hi, @snicoll , what should I do?
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.
In the conversation above we've identified that Test Containers does not have such product name so the current PR is wrong. Also @bsideup was suggesting to write a test for the lookup part. Would you be willing to rework the PR to that effect please?
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.
Sure, but I hava some questions.
Assuming that the current testcontainers is a pair of mysql packaging, if we dynamically match the produceName to mysql, will it cause confusion? Testcontainers itself does not seem to rename the driver for its packaging.
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 but I don't understand the question. The bottom line here is that test containers does not have a product name and as such the first argument of that enum should be null
. Tests should be updated accordingly.
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 thought you mean that there must be a product name for Testcontainers. I've changed it to null now. For test, I'm not sure what @bsideup wants to express, so the lookup part I wrote for test case is for "fromJdbcUrl" method. If there are other changes or suggestions about test, please let me know. Thanks!
Thanks @polarbear567, rather than this back and forth on the test, I've polished your proposal with the additional test, see 4c7896b |
No description provided.