-
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
"idea.classpath.index.enabled" should be false in tests #21
Comments
Please provide as small as possible project sample and steps to reproduce the problem, I'll try to do something with it. And just to make it clearer:
Plugin automatically and intentionally sets it to true.
Since you can |
I will do it, but I need some time. In the meantime here is the actual project where I am facing the issue: https://github.com/alexeykudinkin/intellij-rust .
Agree :) The point is that I've spent quite some time tracing the failing tests down to |
I've found how IDEA invalidates classpath.index, but still need some example to test. |
Here you are: https://github.com/matklad/test-plugin
|
Looks like the real speed up can be noticed on IDEA project only. It's easier to disable indexing classpath in tests. Will be fixed in 0.0.27 |
this flag is needed for starting IDEA from IDEA |
@nicity flag is always false while running IDEA from IDEA in plugin-projects https://github.com/JetBrains/intellij-community/blob/master/plugins/devkit/src/run/PluginRunConfiguration.java#L143 |
Right, plugin-project is not IDEA project |
@nicity I thought that the flag is always true for tests but looks like I missed the condition about IDEA project here https://github.com/JetBrains/intellij-community/blob/master/plugins/devkit/src/run/JUnitDevKitPatcher.java#L50 There is no classloader customization for non-idea project, so the flag doesn't affect anything. |
@nicity and still we don't run IDEA from IDEA with UrlClassLoader, only tests in IDEA project |
BootstrapClassLoaderUtil near word usePersistentClasspathIndexForLocalClassDirectories |
@nicity I see, thanks |
Huh looks that this problem is still there, probably with the new |
@PawelLipski That happens just during the code instrumentation task, right? |
I'm not sure, still researching... but probably not only. I've disabled the following tasks:
but still seeing classpath.index generated, and Gradle reporting that it doesn't know where |
Have you tried 1.7.0-SNAPSHOT? |
Also! as a workaround, I tried setting test {
systemProperty "idea.classpath.index.enabled", "false"
} and/or passing find . -name classpath.index -delete || true right after running the tests :// |
Huh lemme check 🤔 |
The same with
Class loader is apparently set to |
Opened #1039, let's track it there instead |
idea.classpath.index.enabled
is set to false in RunIdea task:https://github.com/JetBrains/gradle-intellij-plugin/blob/master/src/main/groovy/org/jetbrains/intellij/RunIdeaTask.groovy#L45
However, for the
test
task it is true. The effect is that if I add a new class and rungradlew test
, tests fail withNoClassDefFoundError
. I can work around it by manually defining the property in thetest
task, but ideally the gradle plugin should do this automatically, or at least provide a method likesetupSystemProperties
.P.S. I am new to gradle so this may be irrelevant, however I do receive
NoClassDefFoundError
in tests due toclasspath.index
The text was updated successfully, but these errors were encountered: