Skip to content

feat: create a junit5 extension #507

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

Closed
wants to merge 4 commits into from

Conversation

lburgazzoli
Copy link
Collaborator

@lburgazzoli lburgazzoli commented Aug 20, 2021

@metacosm @csviri I had some spare time and I have started hacking a JUnit 5 extension to make it easy to run integration tests.

It is quire basic at the moment but my goal is:

  • to make it possible to either use a real Kubernetes cluster or a mocked one provided by the fabric8
  • if possible run test in parallel as each test runs in its own namespace

Let me know if you think it is work to create such JUnit 5 extensions

@lburgazzoli lburgazzoli force-pushed the junit-ext branch 4 times, most recently from b60afb3 to ef78ead Compare August 20, 2021 15:23
@@ -253,13 +258,21 @@ private void throwMissingCRDException(String crdName, String specVersion, String
return false;
}

private static class ControllerRef {
public static class ControllerRef {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan on making this class more widely used, cf #496

public final ResourceController controller;
public final ControllerConfiguration configuration;

public ControllerRef(ResourceController controller, ControllerConfiguration configuration) {
this.controller = controller;
this.configuration = configuration;
}

public ResourceController getController() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add getters if the instance variables are public final… Use one or the other :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a leftover when using the ResourceController as part of some stream operation so getter/setter where require for method references

@csviri
Copy link
Collaborator

csviri commented Aug 23, 2021

@metacosm @csviri I had some spare time and I have started hacking a JUnit 5 extension to make it easy to run integration tests.

It is quire basic at the moment but my goal is:

  • to make it possible to either use a real Kubernetes cluster or a mocked one provided by the fabric8
  • if possible run test in parallel as each test runs in its own namespace

Let me know if you think it is work to create such JUnit 5 extensions

Maybe we should discuss this issue, running integration/functional tests in parallel would boost the speed of the test. However there is a benefit to have tests isolated completely (the runs), it's already quite hard analyse and find the problem in those tests in case of failure.

@lburgazzoli
Copy link
Collaborator Author

@metacosm @csviri I had some spare time and I have started hacking a JUnit 5 extension to make it easy to run integration tests.
It is quire basic at the moment but my goal is:

  • to make it possible to either use a real Kubernetes cluster or a mocked one provided by the fabric8
  • if possible run test in parallel as each test runs in its own namespace

Let me know if you think it is work to create such JUnit 5 extensions

Maybe we should discuss this issue, running integration/functional tests in parallel would boost the speed of the test. However there is a benefit to have tests isolated completely (the runs), it's already quite hard analyse and find the problem in those tests in case of failure.

The tests are isolated as each test runs it its own namespace so there should not be any interference by many tests running in parallel. We can make the parallel run something we enable only in CI

@lburgazzoli
Copy link
Collaborator Author

superseded by #545

@lburgazzoli lburgazzoli deleted the junit-ext branch September 16, 2021 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants