-
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
Disabling starting Quarkus in QuarkusTests #5310
Comments
I'm not sure it will ends up with the same implementation but I would also love to have a way to bootstrap Quarkus but not the application, to be able to have unit test and not integration test with Quarkus. Today, when we want unit testing one componenent, we will either use a mock framework and not Quarkus test support or use the Quarkus test support to be able to inject the component we want to test, but pay a high price for it (at least 2s to launch the test as Quarkus launch the apps). What I would want is to be able to inject any type of class of my application inside my test (Panache entity/repository, Rest endpoint, ... any CDI beans) without the need to launch fully my apps (without resteasy be boostraped and a port used). |
I fully +1 both approaches. That is very much needed in order to build up more efficient test suites (e.g. separating the test life cycle from the test env life cycle, if more complex (local) setups are required). Also having a fast way to verify the code-level integration w/o starting is a huge +1 for dev experience. |
I also agree. I need it too for my systemtests, which should inject an entitymanager for creating test data. the test itself will run its Rest Requests against a docker container from testcontainers. there is no need to run the app by @QuarkusTest but there is a need to inject sth into my test. |
Does |
2023 update from my side: no, not really, I basically (almost) never use the This is how I try to maximize the test execution effectiveness in my projects: https://blog.sebastian-daschner.com/entries/quarkus-effective-test-execution |
Thanks for the update! |
Description
Ok I know it might some weird at the beginning and your quick answer will be, don't annotate test with QuarkusTest annotation, but today I have done a talk about Quarkus and one attendee raised the next use case.
I am running continuos testing tool like https://infinitest.github.io/
Then I want to start at dev mode the quarkus application, do a change, this change is reflected to running instance and infinitest runs the the test against the new instance.
I know here there is one problem and it is what's happen if infinitest runs before quarkus update. But assuming that this can be workaround then you have the problem that Quarkus is starting a new instance so you are loosing some time booting up when you already have an instance running (dev mode one).
Of course you might say, "then do not annotate the test with the QuarkusTest" but the idea is that you run infinitest in local development and then the same tests are executed correctly in CI systems.
So the idea would be to have a configuration attribute that if it is set to true, then Quarkus test does not start the application and just assumes that it is running in localhost 8080.
Implementation ideas
By default this property should be disabled.
The text was updated successfully, but these errors were encountered: