aboutsummaryrefslogtreecommitdiffstats
path: root/it
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2019-09-03 15:59:11 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2019-09-05 10:03:19 +0200
commitdae4decaa165461d2cdd52860e93fc6c2dd0f493 (patch)
treec0390097f8c018e8bdf49709ff1788efa21b8822 /it
parent3091d1bb8bfdb695942afdac41a5fa7c79a8ebc8 (diff)
downloadsonar-scanner-cli-dae4decaa165461d2cdd52860e93fc6c2dd0f493.tar.gz
sonar-scanner-cli-dae4decaa165461d2cdd52860e93fc6c2dd0f493.zip
SQSCANNER-61 Consider 'project.settings' if set using SONARQUBE_SCANNER_PARAMS4.1.0.1829
Diffstat (limited to 'it')
-rw-r--r--it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java13
1 files changed, 13 insertions, 0 deletions
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 c0c2875..f748d21 100644
--- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java
+++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java
@@ -25,6 +25,7 @@ import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.stream.Collectors;
+import org.apache.commons.lang.StringEscapeUtils;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
@@ -209,4 +210,16 @@ public class ScannerTest extends ScannerTestCase {
assertThat(getComponent("sample-with-custom-settings-path").getName()).isEqualTo("Test with custom settings location");
}
+ // SQSCANNER-61
+ @Test
+ public void should_override_project_settings_path_using_env_variable() {
+ File projectHome = new File("projects/override-project-settings-path");
+ SonarScanner build = newScanner(projectHome)
+ .setEnvironmentVariable("SONARQUBE_SCANNER_PARAMS", "{"
+ + "\"project.settings\" : \"" + StringEscapeUtils.escapeJavaScript(new File(projectHome, "conf/sq-project.properties").getAbsolutePath()) + "\"}");
+ orchestrator.executeBuild(build);
+
+ assertThat(getComponent("sample-with-custom-settings-path").getName()).isEqualTo("Test with custom settings location");
+ }
+
}