Repository navigation
test: run the tests that need the JavaScript plugin in a test task of their own - #2008
Conversation
… their own The tests' sandbox disables the JavaScript and CSS plugins (redhat-developer#1931), and CI's default legs run IntelliJ IDEA Community, which has neither. So DAPExpressionCodeFragmentJavaScriptTest (redhat-developer#2001) returned at its first line in every run and passed without testing anything. testJavaScript, registered with intellijPlatformTesting.testIde, runs the tests named *JavaScriptPluginTest in a sandbox of its own, which keeps the JavaScript plugin; test leaves them out. The IntelliJ Platform Gradle Plugin makes check run it. On IntelliJ IDEA Ultimate (-PplatformType=IU), which bundles the plugin, it runs, as on CI's 2026.3 leg; elsewhere it is skipped. The test is renamed to DAPExpressionCodeFragmentJavaScriptPluginTest, and fails instead of returning when the plugin isn't loaded. Validated: - testJavaScript on IntelliJ IDEA Ultimate 2024.2 and 2026.3: 1 test, 0 failures. - With the production change of redhat-developer#2001 reverted, it fails with the ClassCastException of redhat-developer#1998. - On Community (the default), testJavaScript is skipped, and test doesn't run the test. - The configuration cache is stored and reused. Fixes redhat-developer#2007
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2008 +/- ##
==========================================
+ Coverage 49.11% 49.12% +0.01%
==========================================
Files 812 812
Lines 32987 32987
Branches 6739 5102 -1637
==========================================
+ Hits 16200 16205 +5
- Misses 14241 14242 +1
+ Partials 2546 2540 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@angelozerr @muescha Tests that need IntelliJ's JavaScript plugin can now run, in
On this PR's 2026.3 leg, The PR changes no shipped code, only the test setup and a test, and it covers a fix that is in 0.30.0, so it goes into 0.30.0 too. |
Fixes #2007
Problem
Tests that need IntelliJ's JavaScript plugin never ran:
prepareTestSandbox, since ci: test on IntelliJ 2025.3 and 2026.3 too, on Linux #1931), so that they don't take over the.js,.tsand.cssfiles that other tests give to LSP4IJ.So
DAPExpressionCodeFragmentJavaScriptTest, added by #2001 for #1998, returned at its first line in every run and passed without testing anything.Change
testJavaScript, registered withintellijPlatformTesting.testIde, runs the tests named*JavaScriptPluginTestin a sandbox that keeps the JavaScript plugin.testleaves them out.checkrun it. On IntelliJ IDEA Ultimate (-PplatformType=IU), which bundles the plugin, it runs, so CI's 2026.3 leg runs it with no workflow change. Elsewhere it is skipped ("the IDE bundles the JavaScript plugin").DAPExpressionCodeFragmentJavaScriptPluginTest. It now fails instead of returning when the plugin isn't loaded, so a sandbox without the plugin shows up as a failure.To run it locally:
./gradlew testJavaScript -PplatformType=IU.Validation
testJavaScript, IntelliJ IDEA Ultimate 2024.2testJavaScript, IntelliJ IDEA Ultimate 2026.3 (CI's IU leg)testJavaScript, Ultimate 2024.2, with the production change of #2001 revertedClassCastExceptionof #1998testJavaScript, Community (default)test --tests '*JavaScriptPluginTest', Communitytestleaves it outThe configuration cache is stored and reused in all of these runs.
Related: #1998, #2001, #1931, #1763.