Is there any support for different test profiles? During my local tests I would like to use "mvn package" which uses the "test" profile. This points to my localhost db. For my devops toolchain I want to use a different test profile because we are using containers and cannot use localhost. Goal is to distinguish between local machine test and cloud env. test.
you mean you run 'mvn packge' which leads to the tests being run - like with 'mvn test' . In this case @QuarkusTest tests will run with the 'test' profile. The same goes for running tests in the ide.
There is a system property (used with '-D') 'quarkus.test.profile'. It leads to this profile being activated:
mvn test -Dquarkus.test.profile=foo
.....
2020-04-10 14:06:20,451 INFO [io.quarkus] (main) Quarkus 1.3.0.Final started in 17.408s. Listening on: http://0.0.0.0:8081
2020-04-10 14:06:20,451 INFO [io.quarkus] (main) Profile foo activated.
You may set this property on the surefire or failsafe plugin in your pom.xml (see 1).
You may also set this property within your IDE on a run/launch configuration to start the test (IntelliJ: use the vm options field and add '-Dquarkus.test.profile=integrate')
https://quarkus.io/guides/maven-tooling
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With