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

DevServices: Passing parameters to TestContainers #16125

Closed
edeandrea opened this issue Mar 30, 2021 · 2 comments · Fixed by #16978
Closed

DevServices: Passing parameters to TestContainers #16125

edeandrea opened this issue Mar 30, 2021 · 2 comments · Fixed by #16978
Labels
kind/enhancement New feature or request
Milestone

Comments

@edeandrea
Copy link
Contributor

edeandrea commented Mar 30, 2021

Description

The new DevServices stuff in 1.13 is awesome! It would be really nice to be able to pass additional parameters directly to testcontainers.

For example:

quarkus.datasource.devservices.image-name=postgres:13
quarkus.datasource.devservices.properties.TC_INITSCRIPT=db/schema.sql

where in src/main/resources/db there is a schema.sql file that creates the schema.

See the Using a classpath init script section from https://www.testcontainers.org/modules/databases/jdbc/

Right now I'm doing this:

%test.quarkus.datasource.jdbc.url=jdbc:tc:postgresql:13:///mydb?TC_INITSCRIPT=db/schema.sql
%test.quarkus.datasource.jdbc.driver=org.testcontainers.jdbc.ContainerDatabaseDriver

Would be nice to be able to get this through the DevServices config.

@edeandrea edeandrea added the kind/enhancement New feature or request label Mar 30, 2021
@geoand
Copy link
Contributor

geoand commented Mar 31, 2021

I am a little confused, doesn't quarkus.datasource.devservices.properties.TC_INITSCRIPT=db/schema.sql already do what you want?

@edeandrea
Copy link
Contributor Author

No it doesn't. When you look at the resolved properties the JDBC url is not a testcontainers url (i.e. jdbc:tc:.......). Its a standard postgres url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants