Skip to content

Commit

Permalink
Fix SonarCloud ITs (new version of SonarJS)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Sep 30, 2020
1 parent 12378ef commit ffa8835
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion its/tests/src/test/java/its/SonarCloudTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import org.sonarqube.ws.client.setting.ResetRequest;
import org.sonarqube.ws.client.setting.SetRequest;
import org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl;
import org.sonarsource.sonarlint.core.NodeJsHelper;
import org.sonarsource.sonarlint.core.WsHelperImpl;
import org.sonarsource.sonarlint.core.client.api.common.Language;
import org.sonarsource.sonarlint.core.client.api.common.analysis.AnalysisResults;
Expand Down Expand Up @@ -203,6 +204,10 @@ public void start() {
Map<String, String> globalProps = new HashMap<>();
globalProps.put("sonar.global.label", "It works");
logs = new ArrayList<>();

NodeJsHelper nodeJsHelper = new NodeJsHelper();
nodeJsHelper.detect(null);

engine = new ConnectedSonarLintEngineImpl(ConnectedGlobalConfiguration.builder()
.setServerId("sonarcloud")
.setSonarLintUserHome(sonarUserHome)
Expand All @@ -217,8 +222,8 @@ public void start() {
.addEnabledLanguage(Language.XML)
.setLogOutput((msg, level) -> {
logs.add(msg);
System.out.println(msg);
})
.setNodeJs(nodeJsHelper.getNodeJsPath(), nodeJsHelper.getNodeJsVersion())
.setExtraProperties(globalProps)
.build());
assertThat(engine.getGlobalStorageStatus()).isNull();
Expand Down

0 comments on commit ffa8835

Please sign in to comment.