-
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
Make Quarkus*IntegrationTest runs use a dedicated "integration" profile for runtime config #24581
Comments
That's a good idea. IMO we should also consider having |
Sounds reasonable indeed |
I also like the idea very much. Anyway, I doubt that just introducing a separate "it" profile would help much. @geoand I appreciate the decision that integration tests use IMHO with a new runtime profile u can just influence runtime configurations. This can already be achieved by using the system property Anyway, I have made the experience that using It's almost impossible to use DevServices during integration tests (@QuarkusIntegrationTest), due to the fact that prod build artifacts are being used. I believe this is even a design issue because on the one hand, you like to have a prod built on the other hand you like to have test infrastructure, both controlled with a single profile configuration ... Long story short: As a Quarkus user the following points are very confusing:
Overall my testing experience with ITs is really frustrating. Although I really appreciated your hard work and I love to work with Quarkus .. |
Thanks for your valuable feedback. I'll think this through some more and see what we can do |
See also #21866 (comment) |
I am also having difficulty with build-time config like What I am trying to do is just to populate dev-services DB for integration-tests. But since I want to populate it only on integration-tests or tests in general, I cannot use same changelog in prod config. As a workaround I just used same changelog file for both test and prod but with parameters. Because the change-log-parameters is a runtime config, I can now specify which change-logs to run for test DB.
|
Thanks for the input |
Interesting. This is also matches what we are doing in our Quarkus projects. Instead of using |
Hello everyone! I basically had the same problem. When running Can anyone help? |
For now, you can use the legacy |
Thanks for the answer. I did the test and actually when running the final jar it added the Detailed code/java/openjdk-17.0.2/bin/java -javaagent:$HOME/.m2/repository/org/jacoco/org.jacoco.agent/0.8.8/org.jacoco.agent-0.8.8-runtime.jar=destfile=$HOME/quarkus-api/target/jacoco-quarkus.exec,append=true -Dquarkus.http.port=8081 -Dquarkus.http.ssl-port=8444 -Dtest.url=http://localhost:8081 -Dquarkus.log.file.path=$HOME/quarkus-api/target/quarkus.log -Dquarkus.log.file.enable=true -Dquarkus.profile=test -jar $HOME/quarkus-api/target/quarkus-app/quarkus-run.jar What ends up generating this error:
Is it possible to run the integration tests with the test scope? I ran it like this, but without success:
|
We are currently using a workaround for this to load our test data into our database through flyway with the help of This test resource only does this and nothing more. @Override
public Map<String, String> start() {
return Map.of("quarkus.profile", "integration", "user.timezone", "UTC");
} And our application.properties %dev.domain.common.flyway.locations=db/migration,db/test/data
%test.domain.common.flyway.locations=${%dev.domain.common.flyway.locations}
%integration.domain.common.flyway.locations=${%dev.domain.common.flyway.locations} Sadly this does not work with all configuration like A right almost forgot this project uses Hibernate reactive so we are using the workaround posted here #10716 (comment) |
Our problem is similar to this, we need some The (incomplete) workaround we had to do involves setting the needed properties in maven-failsafe This makes it build successfully but makes running the test in the IDEs fail (as they don't use the maven-failsafe config), so in order to run them from the IDE you need to add the properties on each launch configuration. Painful, but it works. The proposal here goes in the right direction and will solve the issue for us while we have no need for different configurations between tests (if the proposal is just 1 namespace like If I would make a request to resolve our situation (and there is a high chance that we overlook something and the approach is plainly wrong) it would be to be able to tell to the build process the build-time properties per integration-test class (and currently the build just launches once, unfortunately 😢 ). Example just for clarification:
Or a more simple using the approach in the opener |
I should clarify that anything we do for this ticket, will be regarding runtime properties - build time properties aren't going to be altered, as that would fundamentally change what |
@geoand Any update on this? Let me summarize my point once again: I'm still struggling using However, this is not my experience, especially when it comes to Additionally, I understand that I can change the runtime profile of the executable during
So what's your opinion on how to handle this situation with the current Quarkus design? Option 1: Don't use Option 2: Compile a dedicated Option 3: Relevant configurations must be switch to be runtime configs, so that we have a chance to recognize them when running the Would love to get some advice to get my Thanks in advance! |
I have not had time to work on this - hopefully I will for Quarkus 3.3.
Thanks for sharing your insights! |
friendly reminder |
I've doing some specific Quarkus related work that requires my full
attention, so this has been moved further back in the queue until
further notice
…On Fri, Nov 3, 2023, 13:18 Christian Berger ***@***.***> wrote:
friendly reminder
—
Reply to this email directly, view it on GitHub
<#24581 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBMDP5OD7ASSRC6JWH6633YCTHJBAVCNFSM5R25BIB2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZZGIZDMMZSHE3A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Description
Currently QuarkusIntegrationTest, QuarkusMainIntegrationTest and NativeImageTest is defaulting to run with "prod" profile during their test runs.
This makes it tricky to use devservice features during integration testing as prod profile might intentionally or unintentionally set values that is not minded for testing.
Implementation ideas
Suggestion to solve that is to introduce a integration profile (named something like "inttest" or "it") that will be used to resolve runtime properties when running against prod built artifacts (which has prod profile in static init).
This allows running integration tests with use of devservices while still use prod profile for truly prod specific settings.
The text was updated successfully, but these errors were encountered: