-
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
Run tests using jdk8 #306
Merged
Merged
Run tests using jdk8 #306
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
2d3b430
to
4a29c11
Compare
saig0
approved these changes
Apr 12, 2022
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.
@remcowesterhoud looks good 👍
The tests in QA are being used by both the testcontainer tests as the embedded tests. Since the testcontainer tests will be run JDK8 the tests written should be compatible with Java 8.
We already had 2 profiles for running either the embedded or the testcontainer tests. In order to run the testcontainer tests with JDK8 some changes to these profiles were required: 1. These profiles should be responsible for which extension dependency they use. For this reason the dependencies have been moved to the profiles. 2. In the `testcontainer` profile we no longer have the `zeebe-process-test-extension` available. This means any test classes using this extension will not compile. For this reason these classes are being excluded from compilation when using this profile. 3. One more thing to note is that the `embedded` profile still has both dependencies. This is because of the ExtendsAbstractsTest. This test verifies that we have implemented all our tests with both extensions. In order to run this test we need to have access to the testcontainer-extension. Finally a new `default` profile has been added. This profile is activated by default and will contain both dependencies. This is generally used for local development. The IDE will compile everything fine because both dependencies are present. Additionally, running `mvn test` will run both the embedded as the testcontainer tests.
This property allows us to skip any code checks in places where we don't want to do these by running `mvn <goal> -DskipChecks`
The build-and-test-testcontainers has been modified to run the testcontainer tests on java 8. Some things to note: 1. We first need to package the application using java 17. In this workflow we will build the docker image for running the engine locally. The engine is not java 8 compatible, so we need to do this using java 17. 2. We need a second `setup-java` action. This will downgrade our java environment to java 8 which we want to use to run the tests. 3. We need to remove the ``.mvn/jvm.config` in our tests. This file contains some `--add-exports` flags which are required by spotless. Java 8 does not know these flags, so we cannot run mvn commands with java 8 whilst this file is available.
Only files have been moved. No code has been changed.
These classes do not get packaged when they are in the test sources. In order for the other classes to extends them they need to be moved to the main sources.
All the modules were defined in the QA pom. These have now been moved to the modules that actually make use of them.
The testcontainer module should only bother testing that this module implements all AbstractTests. The same goes for the embedded module.
Instead of using maven profiles to decide which tests we want to run in which scenario, we now use the new modules for this.
4a29c11
to
9ab17f9
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We claim to have the guarantee that the
zeebe-process-test-extension-testcontainer
is java 8 compatible. We are guaranteeing this by setting the java version in the maven configuration. However, we do not test this in our CI. The testcontainer tests we have are still being run with java 17.This has been done by splitting the QA module into 3 separate modules. 1 for the abstract tests, 1 for the embedded tests and 1 for the testcontainer tests. By excluding / including specific modules we can configure what tests we want to run in which scenario.
Please note: this PR has been based off of #288. Here we did the same thing using a different approach. Instead of restarting from the beginning I based this solution off of this branch and modified what was necessary. This is why the first commits are introducing the maven profiles. The relevant commits in this PR are the commits from the 11th of April.
To me using these modules are a more maintainable approach compared to the profiles.
Related issues
closes #287
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
Testing:
Documentation: