Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
afalhambra opened this issue Sep 16, 2021 · 2 comments · Fixed by #20223
Assignees
Labels
area/testing kind/bug Something isn't working
Milestone

Comments

@afalhambra
Copy link

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

@afalhambra afalhambra added the kind/bug Something isn't working label Sep 16, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 16, 2021

/cc @geoand

@geoand geoand self-assigned this Sep 17, 2021
geoand added a commit to geoand/quarkus that referenced this issue Sep 17, 2021
@geoand
Copy link
Contributor

geoand commented Sep 17, 2021

Thanks for reporting!

#20223 fixes the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants