forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GEODE-4181: Add JUnit 5 Support (apache#6911)
Added JUnit 5 support to all Geode projects that use `geode-junit`. This is a re-do of PR 6740 with the addition of a new parameterized test runner. See the GEODE PARAMS RUNNER section (below) for details. STANDARD TEST TASKS Updated **./gradle/test.gradle** to configure these standard test tasks to use JUnit Platform to run tests: - `test` and `repeatUnitTest` - `acceptanceTest` and `repeatAcceptanceTest` - `distributedTest` and `repeatDistributedTest` - `integrationTest` and `repeatIntegrationTest` - `performanceTest` - `uiTest` - `upgradeTest` and `repeatUpgradeTest` STANDARD TEST MODULES Updated **./geode-junit/build.gradle**: - Added `junit-jupiter-api` and `junit-jupiter-params` as API dependencies. - Added `junit-jupiter-engine` and `junit-vintage-engine` as implementation dependencies. These changes add JUnit 5 support to any source set that depends on `geode-junit`, either directly or via `geode-dunit`. OTHER PROJECTS Added `junit-vintage-engine` dependency directly to each project that runs tests without `geode-junit` or `geode-dunit`: - `geode-common` - `geode-concurrency-test` - `geode-jmh` - `geode-modules` - `geode-rebalancer` - `static-analysis:pmd-rules` These changes **do not** add JUnit 5 support to these projects. Developers who want JUnit 5 support in these projects can declare dependencies on `junit-jupiter-api`, `junit-jupiter-params`, and `junit-jupiter-engine`. SPECIFIC TESTS Change `ConcurrencyRuleTest` to expect the exception types and exception messages thrown by AssertJ when `opentest4j` is on the classpath. GEODE PARAMS RUNNER **Problem:** Geode commonly uses `JUnitParamsRunner` to run parameterized tests. This runner is incompatible with JUnit Vintage, the test engine that JUnit 5 uses to run JUnit 4 tests. Specifically: - `JUnitParamsRunner` discards `@Category` annotations when describing parameterized tests. JUnit Vintage needs this information to filter tests by category. - When JUnit Vintage asks `JUnitParamsRunner` to exclude a parameterized test by name, the runner applies the filter not to the individual tests with parameterizations, but to the suite that the runner created to contain the parameterized tests. The filter fails to exclude parameterized tests. As a result of these issues, Geode's Windows Gfsh distributed test CI job ends up running hundreds of unwanted tests. Numerous of these fail on Windows. **Solution:** Introduce `GeodeParamsRunner`, which extends and adapts `JUnitParamsRunner` to be compatible with JUnit Vintage. **Caveat:** When `GeodeParamsRunner` is asked to exclude a specific parameterization of a test method, it excludes *all* parameterizations of that test method. This makes it impossible to run a single parameterization of a given test method, or to exclude a single parameterization. This quirk does not affect any CI jobs, but may confuse a developer who tries to use `--tests` to run a single parameterization.
- Loading branch information
1 parent
468e0a3
commit fc75182
Showing
19 changed files
with
684 additions
and
13 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.