Skip to content

Failed to pass quarkus.profile to more than one integration test case when testing native executable #47400

@mimiyanwk

Description

@mimiyanwk

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:

  1. create two different profiles in application.properties and two integration test cases
  2. build native executable: mvn package -Dnative -Dquarkus.native.container-build=true -DskipTests -Dskip.surefire.tests=true -Dquarkus.profile=test
  3. run integration tests: mvn test-compile failsafe:integration-test -Dnative -Dquarkus.profile=test
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions