Skip to content

Commit ffa8835

Browse files
committed
Fix SonarCloud ITs (new version of SonarJS)
1 parent 12378ef commit ffa8835

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

its/tests/src/test/java/its/SonarCloudTest.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import org.sonarqube.ws.client.setting.ResetRequest;
6060
import org.sonarqube.ws.client.setting.SetRequest;
6161
import org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl;
62+
import org.sonarsource.sonarlint.core.NodeJsHelper;
6263
import org.sonarsource.sonarlint.core.WsHelperImpl;
6364
import org.sonarsource.sonarlint.core.client.api.common.Language;
6465
import org.sonarsource.sonarlint.core.client.api.common.analysis.AnalysisResults;
@@ -203,6 +204,10 @@ public void start() {
203204
Map<String, String> globalProps = new HashMap<>();
204205
globalProps.put("sonar.global.label", "It works");
205206
logs = new ArrayList<>();
207+
208+
NodeJsHelper nodeJsHelper = new NodeJsHelper();
209+
nodeJsHelper.detect(null);
210+
206211
engine = new ConnectedSonarLintEngineImpl(ConnectedGlobalConfiguration.builder()
207212
.setServerId("sonarcloud")
208213
.setSonarLintUserHome(sonarUserHome)
@@ -217,8 +222,8 @@ public void start() {
217222
.addEnabledLanguage(Language.XML)
218223
.setLogOutput((msg, level) -> {
219224
logs.add(msg);
220-
System.out.println(msg);
221225
})
226+
.setNodeJs(nodeJsHelper.getNodeJsPath(), nodeJsHelper.getNodeJsVersion())
222227
.setExtraProperties(globalProps)
223228
.build());
224229
assertThat(engine.getGlobalStorageStatus()).isNull();

0 commit comments

Comments
 (0)