snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

QuarkusTestResourceLifecycleManager is not called when used in QuarkusIntegrationTest annotated classes #424

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

I'm currently trying to test a Quarkus application by running some integration tests. However, I have scenarios where I need sometimes to dynamically change some of the runtime properties accordingly before the Quarkus app is launched.

To achieve this, I have my integration test classes annotated with @QuarkusIntegrationTest and using QuarkusTestResourceLifecycleManager resources to change some runtime properties and return them as a map. However, the test resource class implementing QuarkusTestResourceLifecycleManager is not being called anytime when the integration test is executed. It seems these test resources are being ignored - They work fine when they are used with classes annotated with @QuarkusTest but not with @QuarkusIntegrationTest.

Expected behavior

So with above scenario, when I execute the integration test I would expect them to behave following the below steps in this order:

  1. Call the test resources classes implementing QuarkusTestResourceLifecycleManager interface.
  2. Start up quarkus app passing the runtime properties defined in the start/init method of the classes implementing the QuarkusTestResourceLifecycleManager interface.
  3. Execute the integration test.

Actual behavior

So with above scenario, I am getting the following behaviour when I execute the integration test:

  1. Start up quarkus app without passing the runtime properties modified by the test resource class implementing QuarkusTestResourceLifecycleManager. This classes are never called.
  2. Integration test is executed

How to Reproduce?

Download attached zip

  1. Extract zip
  2. run mvn clean install
  3. Unit test will success and Integration test will fail

reproducer.zip

Output of uname -a or ver

Linux antferna.remote.csb 4.18.0-305.12.1.el8_4.x86_64 #1 SMP Mon Jul 26 08:06:24 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.12" 2021-07-20 LTS

GraalVM version (if different from Java)

none

Quarkus version or git rev

2.2.0.CR1

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

maven 3.6.3

Additional information

No response


https://github.com/quarkusio/quarkus/issues/20205


$upstream:20205$