diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2023-08-04 11:07:40 -0500 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2023-08-15 09:41:12 -0500 |
commit | bbd12cf8b78cbb51dc4674642ccfff7baecb7de0 (patch) | |
tree | ef6e54e601eabbdfd5e97ed9b022051f6084bfda /it | |
parent | a045fcd1fdadf09d3e533f83ad749a5898e68470 (diff) | |
download | sonar-scanner-cli-bbd12cf8b78cbb51dc4674642ccfff7baecb7de0.tar.gz sonar-scanner-cli-bbd12cf8b78cbb51dc4674642ccfff7baecb7de0.zip |
SQSCANNER-117 Add IT
Diffstat (limited to 'it')
-rw-r--r-- | it/projects/simple-js/file.js | 3 | ||||
-rw-r--r-- | it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java | 14 | ||||
-rw-r--r-- | it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java | 10 |
3 files changed, 22 insertions, 5 deletions
diff --git a/it/projects/simple-js/file.js b/it/projects/simple-js/file.js new file mode 100644 index 0000000..85ddcdb --- /dev/null +++ b/it/projects/simple-js/file.js @@ -0,0 +1,3 @@ +function msg(){ + alert("Hello JS"); +}
\ No newline at end of file diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java index 0058830..3241b16 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java +++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java @@ -53,6 +53,20 @@ public class ScannerTest extends ScannerTestCase { } /** + * SQSCANNER-117 + */ + @Test + public void analyzers_can_spawn_processes() { + SonarScanner build = newScanner(new File("projects/simple-js")) + .useNative() + .setProjectKey("SAMPLE"); + orchestrator.executeBuild(build); + Map<String, Measure> projectMeasures = getMeasures("SAMPLE", "files", "ncloc"); + assertThat(parseInt(projectMeasures.get("files").getValue())).isEqualTo(1); + assertThat(parseInt(projectMeasures.get("ncloc").getValue())).isGreaterThan(1); + } + + /** * Replace the maven format groupId:artifactId by a single key */ @Test diff --git a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java index 73e011e..fbaa5b8 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java +++ b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java @@ -36,13 +36,13 @@ public class SonarScannerTestSuite { private static Orchestrator createOrchestrator() { String sonarVersion = System - .getProperty("sonar.runtimeVersion", "LATEST_RELEASE[7.9]"); + .getProperty("sonar.runtimeVersion", "LATEST_RELEASE[9.9]"); return Orchestrator.builderEnv() .useDefaultAdminCredentialsForBuilds(true) - .setSonarVersion( - sonarVersion).addPlugin(MavenLocation - .of("org.sonarsource.sonarqube", "sonar-xoo-plugin", - sonarVersion)).build(); + .setSonarVersion(sonarVersion) + .keepBundledPlugins() + .addPlugin(MavenLocation.of("org.sonarsource.sonarqube", "sonar-xoo-plugin", sonarVersion)) + .build(); } } |