-
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
Provide proper error message when using @ConfigProperty in @QuarkusIntegrationTest #24579
Conversation
…tegrationTest These tests do not support injection (as they are not beans), but this fact is not obvious. This error message (which is analogous to what we already have with @Inject) should make this fact salient.
Did this because @alesj ran into this issue |
@geoand this change block one of our use-cases where we are using Here we want to access it - https://github.com/quarkus-qe/beefy-scenarios/blob/main/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/AbstractPingPongResourceTest.java#L27 Property is set here: https://github.com/quarkus-qe/beefy-scenarios/blob/main/010-quarkus-opentracing-reactive-grpc/src/test/java/io/quarkus/qe/containers/JaegerTestResource.java#L48 Reproducer:
|
An integration test should not be using that since the injection does not work |
It works, see case with 2.7.5.Final. We are setting the property when JaegerTestResource.java#L48 starts and getting that in the test. We are not using any property from the application |
I am not really keen on reverting this just because of that weird case to be honest, but if other folks think otherwise, I'll do it. |
I'm not asking to revert this PR. Just wanted to point out the case for breaking change. Do you have any idea how we could propagate the URL of started jaeger service to the test case? |
Yes, I am aware, hence the label.
You are basically already doing this, so you could just any marker annotation to do the same thing |
🤦 thanks for the push with marker annotation |
quarkusio/quarkus#24579 - @ConfigProperty is not intended for integration tests
:) |
quarkusio/quarkus#24579 - @ConfigProperty is not intended for integration tests
Due to quarkusio/quarkus#24579, we cannot use @ConfigProperty in integration tests, so I used a similar workaround quarkus-qe/beefy-scenarios#275
* [main] Bump Quarkus version to 2.9.0.CR1 * added bytebuddy dependency for mockito * Added QuarkusIntegrationTestProperty annotation Due to quarkusio/quarkus#24579, we cannot use @ConfigProperty in integration tests, so I used a similar workaround quarkus-qe/beefy-scenarios#275 * remove ConfigProperty handling from test resource * change name to QuarkusTestProperty * updated QuarkusTestProperty to contain defaultValue * updated QuarkusTestProperty * updated QuarkusTestProperty set * update to 2.9.0.Final Co-authored-by: Jenkins CI <[email protected]> Co-authored-by: radtriste <[email protected]>
* [main] Bump Quarkus version to 2.9.0.CR1 * added bytebuddy dependency for mockito * Added QuarkusIntegrationTestProperty annotation Due to quarkusio/quarkus#24579, we cannot use @ConfigProperty in integration tests, so I used a similar workaround quarkus-qe/beefy-scenarios#275 * remove ConfigProperty handling from test resource * change name to QuarkusTestProperty * updated QuarkusTestProperty to contain defaultValue * updated QuarkusTestProperty * updated QuarkusTestProperty set * update to 2.9.0.Final Co-authored-by: Jenkins CI <[email protected]> Co-authored-by: radtriste <[email protected]>
* [main] Bump Quarkus version to 2.9.0.CR1 * added bytebuddy dependency for mockito * Added QuarkusIntegrationTestProperty annotation Due to quarkusio/quarkus#24579, we cannot use @ConfigProperty in integration tests, so I used a similar workaround quarkus-qe/beefy-scenarios#275 * remove ConfigProperty handling from test resource * change name to QuarkusTestProperty * updated QuarkusTestProperty to contain defaultValue * updated QuarkusTestProperty * updated QuarkusTestProperty set * update to 2.9.0.Final Co-authored-by: Jenkins CI <[email protected]> Co-authored-by: radtriste <[email protected]>
* [main] Bump Quarkus version to 2.9.0.CR1 * added bytebuddy dependency for mockito * Added QuarkusIntegrationTestProperty annotation Due to quarkusio/quarkus#24579, we cannot use @ConfigProperty in integration tests, so I used a similar workaround quarkus-qe/beefy-scenarios#275 * remove ConfigProperty handling from test resource * change name to QuarkusTestProperty * updated QuarkusTestProperty to contain defaultValue * updated QuarkusTestProperty * updated QuarkusTestProperty set * update to 2.9.0.Final Co-authored-by: Jenkins CI <[email protected]> Co-authored-by: radtriste <[email protected]> Co-authored-by: kie-ci <[email protected]> Co-authored-by: Jenkins CI <[email protected]>
* [main] Bump Quarkus version to 2.9.0.CR1 * added bytebuddy dependency for mockito * Added QuarkusIntegrationTestProperty annotation Due to quarkusio/quarkus#24579, we cannot use @ConfigProperty in integration tests, so I used a similar workaround quarkus-qe/beefy-scenarios#275 * remove ConfigProperty handling from test resource * change name to QuarkusTestProperty * updated QuarkusTestProperty to contain defaultValue * updated QuarkusTestProperty * updated QuarkusTestProperty set * update to 2.9.0.Final Co-authored-by: Jenkins CI <[email protected]> Co-authored-by: radtriste <[email protected]>
These tests do not support injection (as they are not beans), but this fact
is not obvious.
This error message (which is analogous to what we already have with
@Inject
)should make this fact salient.