Skip to content

application-it.yaml ignored in IT native build #49428

@vsevel

Description

@vsevel

Describe the bug

I am trying to use quarkus.test.integration-test-profile
I have a src/main/resources/application.properties with:

quarkus.test.integration-test-profile=it
quarkus.native.resources.includes=application-it.properties

and a src/main/resources/application-it.properties with:

foo=bar

and a endpoint:

@Path("/hello")
public class GreetingResource {

    @ConfigProperty(name = "foo", defaultValue = "xx")
    String foo;

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    @Path("/foo")
    public String foo() {
        return foo;
    }
}

and my tests:

@QuarkusTest
class GreetingResourceTest {

    @Test
    void testProp() {
        given()
                .when().get("/hello/foo")
                .then()
                .statusCode(200)
                .body(is(getFoo()));
    }

    protected String getFoo() {
        return "xx";
    }
}
@QuarkusIntegrationTest
class GreetingResourceIT extends GreetingResourceTest {

    protected String getFoo() {
        return "bar";
    }
}

this works fine with:

mvn package => OK (found 'xx')
mvn verify -DskipITs=false => OK (found 'bar')

but it fails if I do:

mvn verify -Pnative => KO (found 'xx')

if I remove file application-it.properties and use application.properties as:

quarkus.test.integration-test-profile=it

%it.foo=bar

then the native IT works (found 'bar').

Expected behavior

should find 'bar'

Actual behavior

find the default value 'xx'.

How to Reproduce?

https://github.com/TechAndOperations/quarkus_reproducers/tree/issue-application-it-ignored

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

3.25.0

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

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions