-
Notifications
You must be signed in to change notification settings - Fork 270
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
New instrumented Jar approach causes tests to test non-production code #1332
Comments
Created tests. Cross-project dependencies are ok, because they are manual and to instrumented jar. And in-project deps are failing. |
This should address issue with test code depending on instrumented code instead of plain code See: JetBrains/intellij-platform-gradle-plugin#1332
The only viable solution for now is to extract some
This way we may specify test runtime dependencies for tests as project(':plugin:core', 'instrumentedJar') |
If you have a default project set up, like project with
main
andtest
roots, gradle setstest
s dependency onmain
classes. Not instrumented jar.Meaning, that in runtime tests will test non-instrumented code and may miss at least nullability issues.
Also, if you have tests for forms created with legacy forms creator, they will just fail, because of missing
setupUI
method.Probably there is a way to tell gradle to use instrumented jar instead of
main
output, but I could not find one.Even if I add instrumented jar dependency to the
testRuntime
, it comes after non-instrumented classes in the resulting classpath and classloader will still resolve to these non-instrumented classes.The only way to solve this I could imagine is to move tests to separate project and specify dependencies explicitly. But this feels really bad.
The text was updated successfully, but these errors were encountered: