-
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
Gradle quarkusIntTest
and specific test profile resolves build properties from prod
for YAML config
#29932
Comments
/cc @glefloch, @quarkusio/devtools |
I originally tried using regular configuration properties but they all worked as expected. I then turned to using the property I was seeing the error with in our build, which was the RabbitMQ property. The only thing I can reason is that it's a build time property but I am not quite as sure of that as the language I used when submitting the issue. |
In search of a workaround, I found that |
@glefloch Correct, The configuration property is somewhat misnamed but it is supposed to be used for integration tests; actually it has been renamed to As pointed out above, running this with an equivalent |
This is the expected behavior, or am I missing something? |
I don't think it is. If you've chosen a profile for integration tests via Also, when |
Yes. that's what I'm saying is expected. Unless
It's pretty confusing I'll admit, but it's the current expected behavior |
Confusing might be an understatement. Why does |
I recently switched to use Quarkus integration tests from our own Gradle solution and it was a couple hours or more of debugging and figuring out why our |
No idea |
Is this still a problem? |
I'm not sure because we use the workaround (for both our versions against 2.16.x and 3.2.x)... we're stilling in the process of switching. Previously you seemed to think it was correct but I'm not sure which behavior you thought was correct considering it operates differently with |
I have no recollection unfortunately :( |
Good point |
I ended up arriving at this solution before even seeing this thread. Still, thanks @kdubb e @geoand ! From the documentation of the After trying for a while, what made me think about passing
here: https://pt.quarkus.io/guides/config-reference#default-runtime-profile |
Describe the bug
When
quarkus.test.native-image-profile
is used withquarkusIntTest
and the configuration is provided via YAML, build time configuration properties are resolved from theprod
profile instead of the profile specified viaquarkus.test.native-image-profile
.The following YAML configuration specifies an invalid credentials provider for RabbitMQ, but it should never be encountered during
quarkusIntTest
because the profile is specified asitest
.This will fail when running
./gradlew quarkusIntTest
; even though it should pass.If you change to using an equivalent
application.properties
the tests pass as expected.Expected behavior
The
prod
profile is completely ignored when a different profile is selected usingquarkus.test.native-image-profile
.Actual behavior
Build time properties are pulled from
prod
regardless of the specifiedquarkus.test.native-image-profile
.How to Reproduce?
With the reproducer below configured as is, running
./gradlew quarkusIntTest
will fail because the container will not start with the errorjava.lang.RuntimeException: unable to find credentials provider of type default
.If you remove/rename the
application.yaml
and rename theapplication.properties.bak
toapplication.properties
, running./gradlew quarkusIntTest
will succeed as expected.inttest-profile.zip
Output of
uname -a
orver
macOS 13.1
Output of
java -version
Oracle JDK 17.0.5
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.15.0 & 2.14.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.6
Additional information
No response
The text was updated successfully, but these errors were encountered: