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

Support tc datasource prefix for test containers #19044

Conversation

polarbear567
Copy link
Contributor

No description provided.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 19, 2019
@polarbear567 polarbear567 force-pushed the enhancement/tcPrefixForTestContainers branch from fef3237 to 8e529c8 Compare November 19, 2019 05:55
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 19, 2019
@snicoll snicoll added this to the 2.3.x milestone Nov 19, 2019
Copy link
Member

@snicoll snicoll left a 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") {
Copy link
Member

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

Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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!

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Nov 21, 2019
@snicoll snicoll removed the status: waiting-for-feedback We need additional information before we can continue label Nov 27, 2019
@snicoll snicoll self-assigned this Nov 27, 2019
@snicoll snicoll modified the milestones: 2.3.x, 2.3.0.M1 Nov 27, 2019
snicoll pushed a commit that referenced this pull request Nov 27, 2019
snicoll added a commit that referenced this pull request Nov 27, 2019
@snicoll snicoll closed this in aca094d Nov 27, 2019
@snicoll
Copy link
Member

snicoll commented Nov 27, 2019

Thanks @polarbear567, rather than this back and forth on the test, I've polished your proposal with the additional test, see 4c7896b

bsideup added a commit to testcontainers/testcontainers-java that referenced this pull request Jan 24, 2020
rnorth pushed a commit to testcontainers/testcontainers-java that referenced this pull request Jan 24, 2020
quincy pushed a commit to quincy/testcontainers-java that referenced this pull request May 28, 2020
@polarbear567 polarbear567 deleted the enhancement/tcPrefixForTestContainers branch November 23, 2021 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants