diennea / carapaceproxy

A Distributed Java Reverse Proxy
Apache License 2.0
23 stars 9 forks source link

Problems with batch test run in Intellij IDEA #440

Closed NiccoMlt closed 1 week ago

NiccoMlt commented 1 year ago

Intellij IDEA is unable to run tests in batches (right click from the files tree) and fails saying that:

org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-vintage' failed to discover tests
Caused by: org.junit.platform.commons.JUnitException: Failed to parse version of junit:junit: 4.13.2

This is due to a bug in JUnit Jupiter version 5.6.2 (see junit-team/junit5#2198) that makes it unable to correctly identify any engine version different from 4.12 and 4.13.

Apparently, org.apache.curator:curator-test imports that version as a transitive dependency:

$ mvn dependency:tree -Dincludes=org.junit.jupiter

...

[INFO] --- dependency:2.8:tree (default-cli) @ carapace-server ---
[WARNING] Parameter 'localRepository' is deprecated core expression; Avoid use of ArtifactRepository type. If you need access to local repository, switch to '${repositorySystemSession}' expression and get LRM from it instead.
[INFO] org.carapaceproxy:carapace-server:jar:1.11.0-SNAPSHOT
[INFO] \- org.apache.curator:curator-test:jar:5.2.0:test
[INFO]    \- org.junit.jupiter:junit-jupiter-api:jar:5.6.2:test

...

We should probably just skip that dependency (as we are using JUnit 4), or update to a more recent JUnit Jupiter version

NiccoMlt commented 1 week ago

Done in 307ba1f