diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-04-13 22:43:53 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-05-02 15:02:42 +0200 |
commit | dd0237017f0b7d5be1c41017d2781c56f64b1332 (patch) | |
tree | a3f569106aedf7353630799d613a4fd7e1630778 | |
parent | d0a3c62a54a9b8070087a1dd2ca03d885998b6d3 (diff) | |
download | sonarqube-dd0237017f0b7d5be1c41017d2781c56f64b1332.tar.gz sonarqube-dd0237017f0b7d5be1c41017d2781c56f64b1332.zip |
Upgrade to Orchestrator 3.15.0.1038
to benefit from better HTTP reliability
8 files changed, 33 insertions, 22 deletions
diff --git a/it/it-tests/src/test/java/it/analysis/SSLTest.java b/it/it-tests/src/test/java/it/analysis/SSLTest.java index 8ee76c6653d..97b40550297 100644 --- a/it/it-tests/src/test/java/it/analysis/SSLTest.java +++ b/it/it-tests/src/test/java/it/analysis/SSLTest.java @@ -24,6 +24,7 @@ import com.sonar.orchestrator.build.BuildResult; import com.sonar.orchestrator.build.SonarScanner; import com.sonar.orchestrator.util.NetworkUtils; import it.Category3Suite; +import java.net.InetAddress; import java.nio.file.Path; import java.nio.file.Paths; import org.eclipse.jetty.http.HttpVersion; @@ -69,8 +70,8 @@ public class SSLTest { } public static void startSSLTransparentReverseProxy(boolean requireClientAuth) throws Exception { - int httpPort = NetworkUtils.getNextAvailablePort(); - httpsPort = NetworkUtils.getNextAvailablePort(); + int httpPort = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress()); + httpsPort = NetworkUtils.getNextAvailablePort(InetAddress.getLoopbackAddress()); // Setup Threadpool QueuedThreadPool threadPool = new QueuedThreadPool(); diff --git a/it/it-tests/src/test/java/it/analysis/TempFolderTest.java b/it/it-tests/src/test/java/it/analysis/TempFolderTest.java index 613ef099e3a..0af1543b3ed 100644 --- a/it/it-tests/src/test/java/it/analysis/TempFolderTest.java +++ b/it/it-tests/src/test/java/it/analysis/TempFolderTest.java @@ -76,21 +76,13 @@ public class TempFolderTest { // SONAR-4748 @Test public void should_not_use_system_tmp_dir() throws Exception { - String oldTmp = System.getProperty("java.io.tmpdir"); - try { - File tmp = temp.newFolder(); - assertThat(tmp.list()).isEmpty(); - - SonarScanner runner = configureScanner() - .setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Djava.io.tmpdir=" + tmp.getAbsolutePath()); - orchestrator.executeBuild(runner); - - // TODO There is one remaining file waiting for SONARPLUGINS-3185 - assertThat(tmp.list()).hasSize(1); - assertThat(tmp.list()[0]).matches("sonar-runner-batch(.*).jar"); - } finally { - System.setProperty("java.io.tmpdir", oldTmp); - } + File tmp = temp.newFolder(); + SonarScanner runner = configureScanner() + .setEnvironmentVariable("SONAR_RUNNER_OPTS", "-Djava.io.tmpdir=" + tmp.getAbsolutePath()); + orchestrator.executeBuild(runner); + + // temp directory is clean-up + assertThat(tmp.list()).isEmpty(); } private BuildResult scan(String... props) { diff --git a/it/it-tests/src/test/java/it/lite/LiteTest.java b/it/it-tests/src/test/java/it/lite/LiteTest.java index d96a9c94cba..3a636529d6c 100644 --- a/it/it-tests/src/test/java/it/lite/LiteTest.java +++ b/it/it-tests/src/test/java/it/lite/LiteTest.java @@ -52,7 +52,7 @@ public class LiteTest { @ClassRule public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - .setContext("/sonarqube") + .setOrchestratorProperty("sonar.web.context", "/sonarqube") .addPlugin(xooPlugin()) .build(); @@ -67,7 +67,7 @@ <slf4j.version>1.7.21</slf4j.version> <tomcat.version>8.5.11</tomcat.version> <elasticsearch.version>2.4.4</elasticsearch.version> - <orchestrator.version>3.15.0.917</orchestrator.version> + <orchestrator.version>3.15.0.1038</orchestrator.version> <okhttp.version>3.3.1</okhttp.version> <jackson.version>2.6.6</jackson.version> 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); } |