-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: bootstrapped junit-jupiter Kubernetes module #4117
Conversation
d29c454
to
b331cf1
Compare
b331cf1
to
c6694f4
Compare
Signed-off-by: Marc Nuri <marc@marcnuri.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
Signed-off-by: Marc Nuri <marc@marcnuri.com>
c6694f4
to
f0f34ba
Compare
SonarCloud Quality Gate failed. |
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.
Amazing, thanks!
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.
LGTM
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.
Looks good! Maybe worth looking into adding support for this in Quarkus in a way similar to the @WithKubernetesTestServer
annotation?
I think for Quarkus we need to provide a specific implementation considering a use case where this client would be injected into the production code. Anyway, for me the first step is releasing the snapshot and see what kind of usages our users make of this. In my case, I will be reusing part of this features in our jkube-integration-tests repository. Further refinements and enhancements might include adding configuration options to the public @interface KubernetesTest {
/**
* Should a namespace be created for the test and the client instance configured to use it?
*/
boolean createNamespace() default true;
/**
* Fixed namespace to use instad of the UUID generated default.
*/
String namespace();
} But following the YAGNI principle, I think that some feedback might be better first. Also note that the JUnit extensions should be composable (check the LoadKubernetesManifestsExtension implementation and LoadKubernetesManifests annotation). I'm commenting this especially for the JOSDK specific extension that could very well reuse the namespace creation part, and then do its own thing. @ExtendWith({ KubernetesNamespacedTestExtension.class, OperatorExtension.class })
public @interface OperatorSdkTest {
// ....
} |
I'm merging now so that it makes it to tonight's snapshot release |
Description
Follow-up on #4054 / #4008
Exposes the JUnit 5 extension in a new kubernetes-junit-jupiter artifact.
As described in #4054, this module would allow you to configure your tests like:
Maybe we can add configuration options in the future to the
@KubernetesTest
annotation:/cc @andreaTP
Type of change
test, version modification, documentation, etc.)
Checklist