Executing tests in mixed (JUnit 4 & 5) test plugins #195
Unanswered
joeshannon
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've just started migrating some tests to JUnit 5. Currently we have a test plugin which contains both JUnit 4 and 5 tests.
The dependencies are included as Import-Package
Now if we launch a JUnit 4 test "Run as JUnit Test" the test does not get executed - we just see empty results in the JUnit view.
Manually configuring the Run Configuration to use the JUnit 4 runner is a workaround but this precludes being able to run e.g. all the tests in the plugin at the same time.
Another workaround is to add the
org.junit.vintage.engine
plugin to the plugin's dependencies which allows both types of tests to run. This however causes the Tycho build to fail with effectively a ClassCastException which I imagine due to the Engine classes being provided by both the plugin's dependencies and Tycho itself.Has anyone else found a solution to this? I'm not entirely sure how the Run Configuration is generated but would it be possible to detect a plugin with both JUnit 4 & 5 dependencies and include the vintage engine if this is the case?
It's also worth noting that this doesn't affect "Run as Plug-in test" (provided that vintage engine is in the target platform) as all Plug-ins are included.
Beta Was this translation helpful? Give feedback.
All reactions