Skip to content
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

Open
lordofthejars opened this issue Nov 8, 2019 · 6 comments
Open

Disabling starting Quarkus in QuarkusTests #5310

lordofthejars opened this issue Nov 8, 2019 · 6 comments
Labels
kind/enhancement New feature or request

Comments

@lordofthejars
Copy link
Contributor

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.

@lordofthejars lordofthejars added the kind/enhancement New feature or request label Nov 8, 2019
@loicmathieu
Copy link
Contributor

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).

@sdaschner
Copy link
Contributor

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.

@BastianSperrhacke-Otto
Copy link

BastianSperrhacke-Otto commented Sep 8, 2020

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.
Did there sth happen the last months? Would be great.

@geoand
Copy link
Contributor

geoand commented Aug 30, 2023

Does @QuarkusComponentTest covers the needs mentioned here?

@geoand geoand added the triage/needs-feedback We are waiting for feedback. label Aug 30, 2023
@sdaschner
Copy link
Contributor

2023 update from my side: no, not really, I basically (almost) never use the @Quarkus*Test annotations in my projects. So for me, this is not an issue (anymore).

This is how I try to maximize the test execution effectiveness in my projects: https://blog.sebastian-daschner.com/entries/quarkus-effective-test-execution

@geoand
Copy link
Contributor

geoand commented Aug 30, 2023

Thanks for the update!

@geoand geoand removed the triage/needs-feedback We are waiting for feedback. label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants