-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not depend on junit-platform-engine for the API #31
Comments
Thanks for pointing that out. I'll have a look at it... |
If I understand you correctly, it's basically an IntelliJ bug - maybe you can paste in the youtrack ID from youtrack.jetbrains.com so that I can follow the progress. Creating two artefacts would be
Your second suggestion does also not feel right, because it would lie about the real dependency. I'm not a maven expert, so here's my question: Does Maven provide a way to exclude transparent dependencies (I loosely remember an tag)? Gradle also has such a mechanism, and I could document the steps to work around this IntelliJ issue until it will be resolved. What do you think? |
It is an IntelliJ problem, that’s correct. There is no YouTrack ticket, only my support ticket which is not public. I don’t see why test discovery should be affected by things on the classpath, but there it is. The IntelliJ test support may depend too much on the structure that JUnit 5 uses itself (separated API and engine). I don’t know what transparent dependencies are, but assuming you mean transitive, then of course, they can be excluded, and that is in fact what I’m doing:
About the ‘lying’ part: I’m not sure it is lying. Nothing in the jqwik library depends on the platform engine. To actually run the tests it is needed, but that is a dependency of the test runtime. You wouldn’t normally include the EL dependency in a WAR when you know it’s going to run in a Tomcat. Feel free not to fix the dependency, but perhaps leave open this ticket for reference if other people stumble upon the same issue. |
"transparent" should be "transitive" of course :-) Leaving the issue open for the time being sounds like a good suggestion. I will add the related Gradle code in another comment. |
@piefel Can you point to an example where I can see the IntelliJ bug or the issue tracker ID for it? I could not reproduce your problem in my experiments. |
I can create a small Git repo and share the link: https://github.com/piefel/junit5-migration-maven |
Has hopefully been resolved with #37 |
jqwik comes with a dependency on junit-platform-engine:
A little surprsingly, this may cause trouble. I have a Maven project that also uses JUnit Jupiter tests and only has the dependency on
junit-jupiter-engine
in the Surefire configuration (Jupiter, in contrast to jqwik, comes with two dependencies, one for the API and one for the engine).When running tests through IntelliJ in this project with 3 engines, often IntelliJ cannot find the tests. The details are not too important (issue raised with JetBrains), but the solution is to exclude the dependency on the platform engine in the POM.
My request here is to split jqwik into API and engine as Jupiter does. Alternatively, exluding junit-platform-engine from the exported dependencies may help, and a note in the docs to include it for the few users that use jqwik exclusively and thus do not get the dependency in any other way.
The text was updated successfully, but these errors were encountered: