-
Notifications
You must be signed in to change notification settings - Fork 15
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
#32: Add capability to write QuarkusIntegrationTests #119
base: main
Are you sure you want to change the base?
#32: Add capability to write QuarkusIntegrationTests #119
Conversation
While at it, reformat and unify code.
b615652
to
08f51ae
Compare
closed, superfluous. |
Premature closure. It is not superfluous after all |
@@ -29,6 +29,10 @@ | |||
<groupId>io.quarkus</groupId> | |||
<artifactId>quarkus-junit5</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.jboss.weld</groupId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this using Weld? Quarkus uses ArC as its CDI implementation?
If I am reading this right you want to be able to basically do injection on the client side outside the packaged application?
Is this really necessary? A normal @QuarkusIntegrationTest does not support injection on the test side, and I think adding a new injection provider into the mix could really confuse things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkouba could we possibly leverage your new QuarkusComponentTest work to allow injection into the client side of integration tests? I am not sure how compelling the use case is but I know we don't want a weld dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this using Weld? Quarkus uses ArC as its CDI implementation?
If I am reading this right you want to be able to basically do injection on the client side outside the packaged application?
Is this really necessary? A normal @QuarkusIntegrationTest does not support injection on the test side, and I think adding a new injection provider into the mix could really confuse things.
@stuartwdouglas See https://groups.google.com/g/quarkus-dev/c/HGZhNw6jsLg/m/KWptjIg6CQAJ - This was the advice given by Ladislav at the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mkouba could we possibly leverage your new QuarkusComponentTest work to allow injection into the client side of integration tests? I am not sure how compelling the use case is but I know we don't want a weld dependency.
I played around with QuarkusComponentTest
and got it working. Only inconvenience is that there must be some configuration on each test class that lists all (entry-) beans. This basically boils down to listing all step-classes and would look something like so:
public class CucumberResourceIT extends CucumberQuarkusIntegrationTest {
@RegisterExtension
static final QuarkusComponentTestExtension COMPONENT_TEST_EXTENSION = new QuarkusComponentTestExtension(
CucumberResourceSteps.class, CucumberResourceActor.class);
public static void main(String... args) {
runMain(CucumberResourceIT.class, args);
}
}
Right now, all classes that we want to be (actually) injected must be listed in the extension configuration. Otherwise, an automatic mock will be created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stuartwdouglas @mkouba I have a POC based on @QuarkusComponentTest
here (github.com
). Usability is still improvable, and we'd need to wait for a release of quarkus containing component tests, but it is a first step. Care to take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so sure it's a good idea to mix the QuarkusComponentTestExtension
with CucumberQuarkusIntegrationTest
. I think that what Stuart meant was to reuse some logic from the QuarkusComponentTestExtension
, i.e. init an ArC container for the classes you want to inject in the CucumberQuarkusIntegrationTest
. Basically some logic from the QuarkusComponentTestExtension.initArcContainer()
and QuarkusComponentTestExtension.afterAll()
methods.
we are interested in this as well. hoping this goes through at some point. |
While at it, reformat and unify code.
Resolves #32