-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
@QuarkusTestResource stopped being started from custom annotation #17930
Comments
/cc @geoand |
Dunno would have to check. @MarcoMartins86 does this same issue occur with |
The repeated annotation was not being properly handled (as was the case of @QuarkusTestResource). This PR handles it in the same way Fixes: quarkusio#17930
#17941 takes care of the issue. For the time being, @MarcoMartins86 you can get around the issue by using @QuarkusTestResource(RedisTestResource.class) instead of @QuarkusTestResource.List({
@QuarkusTestResource(RedisTestResource.class)
}) And on a related note, as of Quarkus |
Thank you for the insights @geoand. In the meanwhile, I tried your workaround and found out what I think is another issue. |
That is the expected behavior when using meta-annotations |
Ok, I didn't know about that because in 1.11.7.Final it was behaving as I described. |
Right, that was by accident :) |
Does this mean that if you run 3 subsequent tests that all have the same meta annotation, the resource is started and stopped three times? |
Yes |
Hm, I must say I find this rather counter-intuitive. I was about to ask if Btw, I'm not complaining and saying this behavior is a bug. But I do see viable room for improvement. Testing runtimes aren't great in my current project and "resource switching" is one reason. |
Fix issue with custom test annotation and @QuarkusTestResource.List
Describe the bug
When I create an annotation (
@MyTestAnnotation
in repo code that reproduces this) for defining common@QuarkusTest
andQuarkusTestResource
annotations and use it to create tests, it will not launch the Quarkus Test Resources since version 1.13.1.Final, and so the test will fail.Expected behavior
Quarkus Test Resources should be launched like in 1.11.7.Final, 1.12.2.Final and 1.13.0.Final and tests should pass.
Actual behavior
Quarkus Test Resources are not launched since 1.13.1.Final and tests fail.
To Reproduce
Clone code from https://github.com/MarcoMartins86/test_annotation_issue
Docker is needed.
Steps to reproduce the behavior:
cd old_version
and run./mvnw clean install
-> Tests will pass.cd new_version
and run./mvnw clean install
-> Tests will fail.Environment (please complete the following information):
Output of
uname -a
orver
Darwin PT-320323-MBP16 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64
Output of
java -version
java version "11.0.9" 2020-10-20 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.9+7-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.9+7-LTS, mixed mode)
Quarkus version or git rev
1.13.1.Final and onwards
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /Users/marco.martins/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.9, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home
Default locale: en_PT, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"
The text was updated successfully, but these errors were encountered: