You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/09/28 20:31:00 UTC

[GitHub] [geode] demery-pivotal opened a new pull request #6911: GEODE-4181: Add JUnit 5 Support

demery-pivotal opened a new pull request #6911:
URL: https://github.com/apache/geode/pull/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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] demery-pivotal merged pull request #6911: GEODE-4181: Add JUnit 5 Support

Posted by GitBox <gi...@apache.org>.
demery-pivotal merged pull request #6911:
URL: https://github.com/apache/geode/pull/6911


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [geode] demery-pivotal merged pull request #6911: GEODE-4181: Add JUnit 5 Support

Posted by GitBox <gi...@apache.org>.
demery-pivotal merged pull request #6911:
URL: https://github.com/apache/geode/pull/6911


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org