aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-04-13 22:43:53 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-05-02 15:02:42 +0200
commitdd0237017f0b7d5be1c41017d2781c56f64b1332 (patch)
treea3f569106aedf7353630799d613a4fd7e1630778 /tests
parentd0a3c62a54a9b8070087a1dd2ca03d885998b6d3 (diff)
downloadsonarqube-dd0237017f0b7d5be1c41017d2781c56f64b1332.tar.gz
sonarqube-dd0237017f0b7d5be1c41017d2781c56f64b1332.zip
Upgrade to Orchestrator 3.15.0.1038
to benefit from better HTTP reliability
Diffstat (limited to 'tests')
-rw-r--r--tests/perf/pom.xml9
-rw-r--r--tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java1
-rw-r--r--tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java3
-rw-r--r--tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java11
4 files changed, 21 insertions, 3 deletions
diff --git a/tests/perf/pom.xml b/tests/perf/pom.xml
index df243bc7b02..c37ae0e7b9b 100644
--- a/tests/perf/pom.xml
+++ b/tests/perf/pom.xml
@@ -52,6 +52,15 @@
<version>${orchestrator.version}</version>
</dependency>
<dependency>
+ <!-- required for downloading the scanner used
+ by some performance tests -->
+ <groupId>org.codehaus.sonar.runner</groupId>
+ <artifactId>sonar-runner-dist</artifactId>
+ <version>2.4</version>
+ <type>zip</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-update-center-common</artifactId>
<version>1.12.1</version>
diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java
index e77ec458df2..b09c3278bfe 100644
--- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java
+++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/HighlightingTest.java
@@ -86,6 +86,7 @@ public class HighlightingTest extends PerfTestCase {
}
SonarScanner scanner = SonarScanner.create()
+ .setScannerVersion("2.4")
.setProperties(
"sonar.projectKey", "highlighting",
"sonar.projectName", "highlighting",
diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java
index 2555a919dc8..76b6b219d6e 100644
--- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java
+++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/IssuesModeTest.java
@@ -61,7 +61,8 @@ public class IssuesModeTest extends PerfTestCase {
"-Xmx512m -server",
"sonar.analysis.mode", "issues",
"sonar.userHome", userHome.getAbsolutePath(),
- "sonar.showProfiling", "true");
+ "sonar.showProfiling", "true")
+ .setScannerVersion("2.4");
long start = System.currentTimeMillis();
orchestrator.executeBuild(runner, false);
long duration = System.currentTimeMillis() - start;
diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java
index e65a4f9c087..01f9532d910 100644
--- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java
+++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/MemoryTest.java
@@ -23,6 +23,7 @@ import com.google.common.base.Strings;
import com.sonar.orchestrator.Orchestrator;
import com.sonar.orchestrator.build.BuildResult;
import com.sonar.orchestrator.build.SonarScanner;
+import com.sonar.orchestrator.http.HttpMethod;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
@@ -31,7 +32,6 @@ import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
-import org.sonar.wsclient.services.PropertyCreateQuery;
import org.sonarsource.sonarqube.perf.MavenLogs;
import org.sonarsource.sonarqube.perf.PerfRule;
import org.sonarsource.sonarqube.perf.PerfTestCase;
@@ -79,6 +79,7 @@ public class MemoryTest extends PerfTestCase {
FileUtils.write(new File(baseDir, "sonar-project.properties"), "sonar.myBigProp=" + Strings.repeat("A", 10000), true);
SonarScanner scanner = SonarScanner.create()
+ .setScannerVersion("2.4")
.setProperties(
"sonar.projectKey", "big-module-tree",
"sonar.projectName", "Big Module Tree",
@@ -92,7 +93,13 @@ public class MemoryTest extends PerfTestCase {
perfRule.assertDurationAround(MavenLogs.extractTotalTime(result.getLogs()), 4847L);
// Second execution with a property on server side
- orchestrator.getServer().getAdminWsClient().create(new PropertyCreateQuery("sonar.anotherBigProp", Strings.repeat("B", 1000), "big-module-tree"));
+ orchestrator.getServer().newHttpCall("/api/settings/set")
+ .setMethod(HttpMethod.POST)
+ .setAdminCredentials()
+ .setParam("key", "sonar.anotherBigProp")
+ .setParam("value", Strings.repeat("B", 1000))
+ .setParam("component", "big-module-tree")
+ .execute();
result = orchestrator.executeBuild(scanner);
perfRule.assertDurationAround(MavenLogs.extractTotalTime(result.getLogs()), 4620L);
}