After adding org.junit.platform.gradle.plugin
into the build and migrating everything from junit4 Gradle started to break with below error.
All runs fine with the vintage runner but junit5 tests are not.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':server:junitPlatformTest'.
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_131\bin\java.exe''
...
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
Do I need to configure the junit5 test consumer somehow to deal with this sort of things? or maybe there is some uber jar handling those?
EDIT1
I have a suspicion this might be the classpath, im going to generate an uberjar with all junit modules.
EDIT2
Looking into the source code seems like Junit plugin adds loads to the classpath
// Note: the user's test runtime classpath must come first; otherwise, code
// instrumented by Clover in JUnit's build will be shadowed by JARs pulled in
// via the junitPlatform configuration... leading to zero code coverage for
// the respective modules.
classpath = project.sourceSets.test.runtimeClasspath + project.configurations.junitPlatform
Im curious if I could wipe out this configuration junitPlatform
after the project evaluate as all JUnit dependencies are added anyway for the code to compile, then the plugin is just adding loads on the top. And I created a project that wraps all Junit5 libs inside one artefact.
EDIT3
I did manage to pack up all jupiter artefacts into 1 to shrink the cp a little, but still my classpath goes over 35k which is a bit weird
How does gradle run junit5 tests then? seems like it puts all transitives from all other projects related, and adds them the cp, which then brakes with error=206