-
Notifications
You must be signed in to change notification settings - Fork 1
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
A way to pass arbitrary flyway config to @FlywayTest #367
Comments
My recommendation is to have something that accepts a Would you like to submit a PR? |
well having a file separate from the test is an impractical solution. I have used wiremock with this setup and soon two problems emerge:
so what I was thinking of, is a kind of passing config like following pseudo-code: @FlywayTest(
value = @DataSource(SomeDataSourceProvider.class),
additionalLocations = {"classpath:some/sql/files/"},
config = {
"key"="value",
"createSchemas"="false",
}
) a better variation is that a config file is also allowed to be passed in (mainly for common config parts) and that additional key value pair defined directly on the annotation just overrides things that should be changed for specific test. for example: @FlywayTest(
value = @DataSource(SomeDataSourceProvider.class),
configFile = "classpath:/some/dir/flyway.conf"
configOverride = {
"key"="value",
"createSchemas"="false",
}
) I could go on and prepare something for this case as it also matches my usage pattern. WDYT? |
Well, I want to avoid translating all the config into the annotation. With a file, you would only need a single parameter in the annotation, and it would be easier to hand over to the Flyway instance. I guess that we could add a repeatable |
I have seen other issues regarding using a file or environment variables to pass configurations to flyway. this might work in some scenarios but in specific cases they are not practical or need much additional effort. like when one has many tests which each need to be configured differently.
A very effective solution (which can also be potentially done very easily) is that one can set an arbitrary map on the
@FlywayTest
to just pass configurations to the instance that is created later. What do you think?The text was updated successfully, but these errors were encountered: