RFR: Upgrade JUnit 5

Christian Stein via github.com duke at openjdk.java.net
Thu Aug 22 14:21:20 UTC 2019


On Thu, 22 Aug 2019 14:10:58 GMT, Erik Duveblad via github.com <duke at openjdk.java.net> wrote:

> On Thu, 22 Aug 2019 11:58:43 GMT, Christian Stein via github.com <duke at openjdk.java.net> wrote:
> 
>> Upgrade JUnit 5 to Jupiter 5.5.1 and Platform 1.5.1
>> 
>> - Set Jupiter version number 5.5.1
>> - Introduce Platform Launcher 1.5.1 test runtime dependency
>>   in order to force Gradle to load the module from the module-path
>> - Add missing "requires 'org.junit.jupiter.params'" directives
>>   in modules: jcheck, storage, vcs, and webrev
>> 
>> Solves https://bugs.openjdk.java.net/projects/SKARA/issues/SKARA-69
>> 
>> ----------------
>> 
>> Commits:
>>  - 5e253f99:	Upgrade JUnit 5 to Jupiter 5.5.1 and Platform 1.5.1
>> 			- Set Jupiter version number 5.5.1
>> 			- Introduce Platform Launcher 1.5.1 test runtime dependency
>> 			in order to force Gradle to load the module from the module-path
>> 			- Add missing "requires 'org.junit.jupiter.params'" directives
>> 			in modules: jcheck, storage, vcs, and webrev
>> 			Solves https://bugs.openjdk.java.net/projects/SKARA/issues/SKARA-69
>> 
>> Pull request:
>> https://git.openjdk.java.net/skara/pull/66
>> 
>> Webrev:
>> https://webrevs.openjdk.java.net/skara/66/webrev.00
>> 
>> Patch:
>> https://git.openjdk.java.net/skara/pull/66.diff
>> 
>> Fetch command:
>> git fetch https://git.openjdk.java.net/skara pull/66/head:pull/66
> 
> build.gradle line 54:
> 
>> 53: 
>> 54:     test {
>> 55:         useJUnitPlatform()
> 
> Hmm, I don't really follow here - how does adding a test runtime dependency on org.junit.platform:junit-platform-launcher:1.5.1 force Gradle to load the JUnit Platform launcher from the module path? Did you forgot to `git add` a change made to `buildSrc/.../ModulePlugin.java`?
> 
> PR: https://git.openjdk.java.net/skara/pull/66

> Did you forgot to `git add` a change...

No. The re-configuration of the Gradle `test` task is good as-is.

IIRC and locally passing tests support that, Gradle uses JUnit Platform Launcher (and its dependencies) from the project dependencies -- and only injects one (on the class-path) if a project doesn't provide it.

With `org.junit.platform:junit-platform-launcher:1.5.1` a) being present on the project's class-path and b) being moved to the module-path by the [`module` plugin](https://github.com/openjdk/skara/blob/master/buildSrc/module/src/main/java/org/openjdk/skara/gradle/module/ModulePlugin.java#L106), things work out again.

Correct me if I'm wrong here, @marcphilipp, @britter, et al.

PR: https://git.openjdk.java.net/skara/pull/66


More information about the skara-dev mailing list