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

refactor: restructure tests, add JVM based e2e tests #139

Merged

Conversation

paullatzelsperger
Copy link
Contributor

@paullatzelsperger paullatzelsperger commented Mar 23, 2023

WHAT

This PR introduces a test framework that leverages EDC's JUnit-based runtimes. That means, it is possible to run (and debug) multiple connector runtimes within the same JVM.

The legacy Cucumber-based business tests have been relocated into a subdirectory edc-tests/cucumber but left otherwise untouched.

As a third change, all "verification" tasks (spotless, checkstyle, all testing, sonar) have been moved into a separate GH Actions workflow to keep the individual workflows nice and succinct.

WHY

using in-mem tests is much faster and more efficient than spinning up a K8S cluster, it is also more stable and avoids timeouts and waiting.

FURTHER NOTES

  • This PR does not replace all business tests with in-mem tests, rather, it lays the foundation and exemplarily shows how e2e tests can be done using just the JVM.

  • We aim to add more of these JVM-based tests over time.

  • most of the large changeset stems from moving the cucumber tests into a different directory

@paullatzelsperger paullatzelsperger marked this pull request as ready for review March 23, 2023 14:17
Copy link
Contributor

@ndr-brt ndr-brt left a comment

Choose a reason for hiding this comment

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

I like this, a lot, because it will permit to apply the "test first" approach on the E2E layer too.
Regarding cucumber I'm not too much against it, I mean, it could be useful especially if we want to have the "non-technical" people to being aware of the behavior of the connector. Did that in the past, worked pretty well.

I also agree that's an additional layer of complexity for us, so, maybe let's take this decision through a decision record, so everyone could have their say

@paullatzelsperger
Copy link
Contributor Author

paullatzelsperger commented Mar 27, 2023

Regarding cucumber I'm not too much against it, I mean, it could be useful especially if we want to have the "non-technical" people to being aware of the behavior of the connector. Did that in the past, worked pretty well.

This PR is about two things:

  • show how the Multi-Runtime JUnit runner works
  • Highlight why the "kill-multiple-birds-with-one-stone" approach isn't good and how it can be improved

So it is not necessarily about removing/replacing Cucumber. Personally I don't like Cucumber, because I find it very fragmented and hard to read (feature files, callbacks, util classes to parse the tables...), but that is besides the point and I'm sure we could make cucumber work with the in-mem runtime, if that's desired.

So yes, deciding whether or not to use Cucumber should absolutely go through a discussion and a decision record, but that was not the goal of this PR.

edc-tests/runtime/build.gradle.kts Outdated Show resolved Hide resolved
edc-tests/runtime/README.md Outdated Show resolved Hide resolved
edc-tests/e2e-tests/README.md Outdated Show resolved Hide resolved
paullatzelsperger and others added 2 commits March 27, 2023 11:56
Co-authored-by: Florian Rusch (ZF Friedrichshafen AG) <[email protected]>
@SebastianBezold SebastianBezold merged commit 79e8906 into eclipse-tractusx:develop Mar 27, 2023
paullatzelsperger pushed a commit to paullatzelsperger/tractusx-edc that referenced this pull request May 4, 2023
…tor_tests

refactor: restructure tests, add JVM based e2e tests
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.

5 participants