-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
TestResourceScope.MATCHING_RESOURCES ignores configuration annotations from QuarkusTestResourceConfigurableLifecycleManager #44129
Comments
/cc @radcortez (config) |
I will have to check this out as I don't really remember any of the details :) |
When you say arguments, I assume you mean the config annotation, right? |
Right. |
So, it's moved to #44279. I think that PR handles To be clear when I talk about "configuration annotations" I mean this: quarkus/test-framework/common/src/main/java/io/quarkus/test/common/TestResourceManager.java Lines 157 to 160 in ac87489
quarkus/test-framework/common/src/test/java/io/quarkus/test/common/TestResourceManagerTest.java Lines 216 to 224 in 12fe9e0
... which is separate from |
Ah right, I had handled that, but forgot about it... I'll open a new PR |
Relates to: quarkusio#44129 (cherry picked from commit 5aa171b)
Take config annotation when trying to match test resources
Describe the bug
From what I can see, only the FQCN of the test resource lifecycle manager and the configured scope are taken into account when grouping together tests with matching resources:
quarkus/test-framework/common/src/main/java/io/quarkus/test/common/TestResourceManager.java
Lines 321 to 332 in 2fc4833
This seems incomplete, as test resource lifecycle managers can implement
QuarkusTestResourceConfigurableLifecycleManager
to be customized per-test, like this:https://github.com/quarkusio/search.quarkus.io/blob/41e3b9f2de465ea2dc74efaa46ee44b310d5cc08/src/test/java/io/quarkus/search/app/testsupport/QuarkusIOSample.java#L510-L531
https://github.com/yrodiere/search.quarkus.io/blob/42ebd004b6fa5d92960b0615fb8ead6b1b6cb726/src/test/java/io/quarkus/search/app/SearchServiceTest.java#L42
Expected behavior
Tests are considered to have matching resources if they have the same resource lifecycle managers with the same arguments.
Actual behavior
Tests are considered to have matching resources if they have the same resource lifecycle managers, regardless of arguments.
How to Reproduce?
Check out quarkusio/search.quarkus.io#345 , revert the last commit, and see how resources are reused despite the
Or, probably simpler, add a unit test next to the existing ones for
@WithTestResource
within Quarkus itself.Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
Related conversation: quarkusio/search.quarkus.io#345
PR introducing the feature: #42852
The text was updated successfully, but these errors were encountered: