You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/09/24 16:40:00 UTC

[jira] [Commented] (GEODE-4181) Update to JUnit 5.x

    [ https://issues.apache.org/jira/browse/GEODE-4181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17419876#comment-17419876 ] 

ASF subversion and git services commented on GEODE-4181:
--------------------------------------------------------

Commit 1d6eef3511926d2a235b6c34577c7b3c0417ecd6 in geode's branch refs/heads/develop from Dale Emery
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=1d6eef3 ]

GEODE-4181: Migrate uses of JUnitParamsRunner (#6890)

Migrate all uses of `JUnitParamsRunner` to use a new runner that can be
made compatible with JUnit 5.

PROBLEM

We want to upgrade Geode to use JUnit 5. JUnit 5 includes a test engine
called JUnit Vintage, which it uses to run JUnit 4 tests. JUnit Vintage
interacts with test runners differently than JUnit 4 did.

`JUnitParamsRunner` is incompatible with JUnit Vintage in several ways:
- When `JUnitParamsRunner` describes parameterized tests, it discards
  the `@Category` annotation that JUnit Vintage uses to filter tests by
  category.
- When JUnit Vintage asks `JUnitParamsRunner` to filter tests by name,
  the runner fails to apply the filter to parameterized tests.

The net result is that when JUnit Vintage tries to filter tests by
category, `JUnitParamsRunner` runs every parameterized test, including
tests that lack the category. This affects the Windows Gfsh distributed
test job in particular, causing it to run 900 tests instead of the
desired 200. Numerous of the extra 700 tests fail on Windows.

This problem prevents us from upgrading to JUnit 5.

`JUnitParamsRunner` is no longer maintained. It will not be made
compatible with JUnit Vintage.

Approximately 140 test classes use `JUnitParamsRunner`. To upgrade to
JUnit 5, we will have to migrate all of these tests to use a runner
compatible with JUnit Vintage.

SOLUTION

The solution involves two steps:
1. Migrate every existing use of `JUnitParamsRunner` to instead use a
   new `GeodeParamsRunner` that behaves identically to
   `JUnitParamsRunner`.
2. Upgrade Geode to use JUnit 5.

This PR implements step 1. This PR implements a "dummy" version of
`GeodeParamsRunner` that behaves identically to `JUnitParamsRunner`. Its
only purpose is to allow migrating approximately 140 test classes to use
the new runner name.

I will implement step 2 in a later PR. This will include re-implementing
`GeodeParamsRunner` to be compatible with JUnit 5. (I have verified the
viability of this via a spike.)

Separating the "migrate the tests" and "upgrade JUnit" steps into
separate PRs makes each PR much more focused and much easier to review.

> Update to JUnit 5.x
> -------------------
>
>                 Key: GEODE-4181
>                 URL: https://issues.apache.org/jira/browse/GEODE-4181
>             Project: Geode
>          Issue Type: Improvement
>          Components: general, tests
>            Reporter: Patrick Rhomberg
>            Assignee: Dale Emery
>            Priority: Major
>              Labels: GeodeOperationAPI, pull-request-available
>
> In addition to the expected benefits that come with new versions, updating to JUnit 5.x should allow us to remove the workaround required in GEODE-1350 / GEODE-4122.
> If migration guides are to be believed, migration from JUnit 4.x to 5.x in and of itself should not be difficult.  However, interaction with Mockito and PowerMock appears to be significantly different and will require investigation.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)