Skip to content

Gradle quarkusIntTest and specific test profile resolves build properties from prod for YAML config #29932

Open
@kdubb

Description

Describe the bug

When quarkus.test.native-image-profile is used with quarkusIntTest and the configuration is provided via YAML, build time configuration properties are resolved from the prod profile instead of the profile specified via quarkus.test.native-image-profile.

The following YAML configuration specifies an invalid credentials provider for RabbitMQ, but it should never be encountered during quarkusIntTest because the profile is specified as itest.

quarkus:
  test:
    native-image-profile: itest

"%itest":
  greeting:
    name: itest

"%prod":
  quarkus:
    rabbitmq:
      credentials-provider: prod

This will fail when running ./gradlew quarkusIntTest; even though it should pass.

If you change to using an equivalent application.properties the tests pass as expected.

Expected behavior

The prod profile is completely ignored when a different profile is selected using quarkus.test.native-image-profile.

Actual behavior

Build time properties are pulled from prod regardless of the specified quarkus.test.native-image-profile.

How to Reproduce?

With the reproducer below configured as is, running ./gradlew quarkusIntTest will fail because the container will not start with the error java.lang.RuntimeException: unable to find credentials provider of type default.

If you remove/rename the application.yaml and rename the application.properties.bak to application.properties, running ./gradlew quarkusIntTest will succeed as expected.

inttest-profile.zip

Output of uname -a or ver

macOS 13.1

Output of java -version

Oracle JDK 17.0.5

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.15.0 & 2.14.3

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.6

Additional information

No response

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions