Failed to pass quarkus.profile to more than one integration test case when testing native executable
Describe the bug
If there are two integration test cases and run the following command:
mvn test-compile failsafe:integration-test -Dnative -Dquarkus.profile=test
only the first test case takes the test profile for the test and the second test case takes the prod profile for the test
Expected behavior
all test cases should take the option passed by the command line for the test
Actual behavior
only the first test case takes the test profile for the test
How to Reproduce?
Steps to reproduce:
- create two different profiles in application.properties and two integration test cases
- build native executable:
mvn package -Dnative -Dquarkus.native.container-build=true -DskipTests -Dskip.surefire.tests=true -Dquarkus.profile=test - run integration tests:
mvn test-compile failsafe:integration-test -Dnative -Dquarkus.profile=test - check console outputs and quarkus.log and you can find that the seconad test cases is using the prod profile, for example console outputs:
for the first test case it looks like:
[io.qua.tes.com.DefaultDockerContainerLauncher] (main) Executing "podman run --name quarkus-integration-test-WVVsG -i --rm -p 8081:8081 -p 8444:8444 --net=it-network --env QUARKUS_LOG_CATEGORY__IO_QUARKUS__LEVEL=INFO --env QUARKUS_HTTP_PORT=8081 --env QUARKUS_HTTP_SSL_PORT=8444 --env TEST_URL=http://localhost:8081/ --env QUARKUS_PROFILE=prod --env QUARKUS_MONGODB_CONNECTION_STRING=mongodb://10.89.0.3:27017 --env KAFKA_BOOTSTRAP_SERVERS=10.89.0.4:9091 --env QUARKUS_PROFILE=test --env QUARKUS_NATIVE_CONTAINER_BUILD=true ..."
for the second test case:
[io.qua.tes.com.DefaultDockerContainerLauncher] (main) Executing "podman run --name quarkus-integration-test-HXrED -i --rm -p 8081:8081 -p 8444:8444 --net=it-network --env QUARKUS_LOG_CATEGORY__IO_QUARKUS__LEVEL=INFO --env QUARKUS_HTTP_PORT=8081 --env QUARKUS_HTTP_SSL_PORT=8444 --env TEST_URL=http://localhost:8081/ --env QUARKUS_PROFILE=prod --env QUARKUS_MONGODB_CONNECTION_STRING=mongodb://10.89.0.6:27017 --env KAFKA_BOOTSTRAP_SERVERS=10.89.0.7:9091 --env QUARKUS_NATIVE_CONTAINER_BUILD=true ..."
Output of uname -a or ver
No response
Output of java -version
GraalVM 22+36.1
Mandrel or GraalVM version (if different from Java)
quay.io/quarkus/ubi9-quarkus-mandrel-builder-image:jdk-21
Quarkus version or git rev
Quarkus 3.20
Build tool (ie. output of mvnw --version or gradlew --version)
graalvm-jdk-22, maven 3.9.1
Additional information
No response
/cc @Karm (native-image), @galderz (native-image), @zakkak (native-image)
It would probably help if you could take the time to assemble a small test case and post it.
Closing for the lack of a reproducer
why was the issue closed? it is so clear to reproduce.
- write two integration tests und use test profile to execute them
- you can see the second test doesn't use test profile.
If someone adds a reproducer as was requested, then we can reopen
Reproducer: code-with-quarkus320
-
run integration tests with command:
./mvnw verify -Dnative -Dquarkus.profile=test -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true -
check quarkus.log:
- if prod profile is used, then you can see the message in json format: database prod
- if test profile is used, then you can see the message in non-json format: database test
-
check console message: you can see the message like the following:
the first test case with env QUARKUS_PROFILE=test: Executing "podman run --name quarkus-integration-test-SDhKa -i --rm -p 8081:8081 -p 8444:8444 --net=quarkus-integration-test-hsfiT --env QUARKUS_LOG_CATEGORY__IO_QUARKUS__LEVEL=INFO --env QUARKUS_PROFILE=prod --env QUARKUS_CONTAINER_IMAGE_BUILD=true --env QUARKUS_PROFILE=test --env QUARKUS_NATIVE_CONTAINER_BUILD=true root/code-with-quarkus320:1.0.0-SNAPSHOT"
the second test case without env QUARKUS_PROFILE=test: Executing "podman run --name quarkus-integration-test-yguHx -i --rm -p 8081:8081 -p 8444:8444 --net=quarkus-integration-test-QxBmq --env QUARKUS_LOG_CATEGORY__IO_QUARKUS__LEVEL=INFO --env QUARKUS_PROFILE=prod --env QUARKUS_MONGODB_CONNECTION_STRING=mongodb://10.89.1.2:27017 --env QUARKUS_CONTAINER_IMAGE_BUILD=true --env QUARKUS_NATIVE_CONTAINER_BUILD=true root/code-with-quarkus320:1.0.0-SNAPSHOT"