Describe the bug
I want to use different database migrations with flyway for testing.
I defined two different locations for the flyway migrations in the application.properties:
%test.quarkus.flyway.locations=classpath:/db/migration/,classpath:/db/testing/
Expected behavior
I expect that all migrations in the folders migration and testing are applied
Actual behavior
Only the migrations in the migration folder are applied, anything in testing is ignored.
To Reproduce
Steps to reproduce the behavior:
quarkus-flyway version newer than 1.4.2quarkus.flyway.locations)Configuration
quarkus.datasource.driver=org.postgresql.Driver
quarkus.datasource.username = ${POSTGRES_USER:postgres}
quarkus.datasource.password = ${POSTGRES_PASSWORD:postgres}
quarkus.datasource.url = ${POSTGRES_URL:jdbc:postgresql://localhost:5432/postgres}
quarkus.flyway.migrate-at-start=true
quarkus.swagger-ui.always-include=true
%test.quarkus.http.test-port=0
%test.quarkus.datasource.driver=org.testcontainers.jdbc.ContainerDatabaseDriver
%test.quarkus.hibernate-orm.dialect=org.hibernate.dialect.PostgreSQL9Dialect
%test.quarkus.datasource.url=jdbc:tc:postgresql:latest:///postgres
%test.quarkus.flyway.migrate-at-start=true
%test.quarkus.flyway.clean-at-start=true
%test.quarkus.flyway.locations=classpath:/db/migration/,classpath:/db/testing/
Environment (please complete the following information):
uname -a or ver:java -version:mvnw --version or gradlew --version):Additional context
This is working in version 1.4.2.Final of quarkus-flyway but not with the newer ones.
Hm... I was not able to reproduce this... Our integration test (https://github.com/quarkusio/quarkus/blob/ecddfb0a2eeb5283fd1ebbf1830737f78cf15d0b/integration-tests/flyway/src/main/resources/application.properties#L14) is properly picking up all locations.
Do you perhaps have a project you can share which displayes the behavior you mention?
How do you apply the test profile when starting the application?
quarkus.flyway.locations is a build time property so it cannot be changed at runtime.
@geoand Unfortunately, I can't share this specific project, it is a company owned internal project, I'll try to create a new project for debugging purpose in the next days.
@gsmet I'm running mvn clean test, this should enable the test profile, right ?
@henrikengelbrink were you able to come up with a reproducer for this? We haven't had anyone report any similar issue
Sorry for the late answer!
I've created a simple project with the same settings/dependencies.
If you run mvn clean test on this repo it will fail, because the SQL scripts in db/test_data are not executed though it is configured in the application.properties. If I change quarkus-flyway version explicit back to 1.4.2.Final it is working.
Thanks @henrikengelbrink.
https://github.com/quarkusio/quarkus/pull/10718 fixes the issue
Thank you @geoand