…il it when it finds no test
Since redhat-developer#2072 set instrumentCode = false, testJavaScript has found no test class. On the IU 2026.3 leg
of CI, it logs "Task :testJavaScript NO-SOURCE", and the build passes. The last run of main where
DAPExpressionCodeFragmentJavaScriptPluginTest ran is that of fe9f583, just before redhat-developer#2072.
Gradle 9 gives the classes and the classpath of the test source set to the test task only. Of those,
the IntelliJ Platform Gradle Plugin 2.20.0 gives a testIde task only the classes of
instrumentTestCode (TestIdeTask: testClassesDirs = instrumentedTestCode + testClassesDirs), and
instrumentCode = false leaves those empty.
testJavaScript now takes testClassesDirs from the test source set, and adds its runtime classpath,
without that of main, whose classes and dependencies come from the plugin in the sandbox, as for test.
The test resources, and with them the HangingTestWatchdog listener, are now on its classpath too.
Gradle skips a test task that finds no test class as NO-SOURCE, before failOnNoDiscoveredTests can
apply. A second onlyIf, evaluated before that and only on an IDE that bundles the JavaScript plugin,
now fails the build when testJavaScript finds no *JavaScriptPluginTest class.
What
testJavaScriptruns the JavaScript plugin tests again (*JavaScriptPluginTest, todayDAPExpressionCodeFragmentJavaScriptPluginTest). It now fails the build when, on an IDE that bundles the JavaScript plugin, it finds no test class.Cause
Since #2072 set
instrumentCode = false,testJavaScripthas found no test class: on CI's IU 2026.3 leg, it logsTask :testJavaScript NO-SOURCE, and the build passes. The last run ofmainwhere the test ran is that of fe9f583, just before #2072 (run 44925663365); from cc1776f, #2072 itself, every run logs NO-SOURCE.Gradle 9 gives the classes and the classpath of the test source set to the
testtask only. Of those, the IntelliJ Platform Gradle Plugin 2.20.0 gives atestIdetask only the classes ofinstrumentTestCode(TestIdeTask:testClassesDirs = instrumentedTestCode + testClassesDirs), whichinstrumentCode = falseleaves empty. A local build can hide this: a leftoverbuild/instrumented/instrumentTestCodefrom a build with instrumentation on makes the task run those old classes.Change
testJavaScripttakestestClassesDirsfrom the test source set. It also adds the test runtime classpath without that of main, whose classes and dependencies come from the plugin in the sandbox, as fortest. That's what the plugin's own integration tests do for atestIdetask withinstrumentCode = false. The test resources, and with them theHangingTestWatchdoglistener, are now on its classpath too.failOnNoDiscoveredTestscan apply. A secondonlyIf, evaluated before that skip and only where the IDE bundles the JavaScript plugin, fails the build whentestJavaScriptfinds no*JavaScriptPluginTestclass.instrumentCode = falsestays (Track the upstream fixes that LSP4IJ waits for or works around #2121 tracks InstrumentCodeTask uses Task.getAnt(), which Gradle 9.9 deprecates and Gradle 10 removes JetBrains/intellij-platform-gradle-plugin#2294).Test
./gradlew testJavaScript -PplatformType=IU -PplatformVersion=2026.3 --rerun-tasks --no-build-cacheruns 1 test, which passes, 4 times out of 4. The configuration cache is stored and then reused.onlyIffor the JavaScript plugin is false, and the build passes.testJavaScripton IU 2026.3 fails: "Could not evaluate spec for 'testJavaScript finds a **/*JavaScriptPluginTest.class'". On IC 2024.2 it's still skipped../gradlew check -PplatformType=IU -PplatformVersion=2026.3 --rerun-tasks --no-build-cachepasses:testruns 1861 tests (7 skipped), andtestJavaScriptruns 1, with no failures.DAPExpressionCodeFragmentJavaScriptPluginTeststill passes after a day of not running.