-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
@QuarkusIntegrationTest starts native executable in prod profile instead of test profile #25519
Comments
I'll try to make the test framework to append |
Appending it explicitly to the maven command makes it work:
Adds the profile here DefaultNativeImageLauncher.java So...I don't know. Close this "issue"? It's somewhat annoying that the Jar Launcher doesn't need it set explicitly then. |
This is the intended behavior |
@geoand Ack. I'll open a doc PR though. |
Great, thanks! |
@geoand I took a look at the building-native-image.adoc#L275, but I don't know how to explain there why in one case If you could take a look at this small reproducer (just a Hello world with 1 tiny entity):
PASS ✔️$ ./mvnw verify -Pnative -Dquarkus-profile=test FAIL ❌$ ./mvnw verify -Pnative -Dquarkus.test.native-image-profile=test You can see that in both cases, the Weirdly enough, the failing scenario executed with I can carry on with my project, using |
This is a tricky one, but it comes down to the fact that unless otherwise specified (i.e. |
@geoand Ah, it all clicked together now. I have this in my CI that deploys to a server:
I know enough to update the doc now. Thx. 👍 |
🎉 |
Isn't it supposed to be |
You are right! |
Describe the bug
I was struggling with database test data population during native-image test in a project and it boiled down to the simple fact that the native-executable is started in prod profile (hence expecting
%prod
values) instead of the test profile the JVM test correctly uses.Expected behavior
native-image executable is started in test profile during test execution.
Actual behavior
native-image executable is started in prod profile during test execution.
How to Reproduce?
I reproduced it with this tiny example downloaded from code.quarkus.io:
Patch with this patch:
Running the tests as:
Passes the JVM mode:
And fails with native:
Note how the Quarkus app starts:
i.e. the profile should be test, not prod.
Output of
uname -a
orver
Linux amd64
Output of
java -version
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
GraalVM version (if different from Java)
native-image 22.1.0.0-Final Mandrel Distribution (Java Version 17.0.3+7)
Quarkus version or git rev
2.9.0.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4
Additional information
No response
The text was updated successfully, but these errors were encountered: