From a2ca041dc1fa1ed762ca43f08fc65503f6b2596b Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Tue, 17 May 2016 10:52:21 +0200 Subject: [PATCH] Fix perf tests without WS cache and non connected mode --- .../perf/scanner/suite/FileSystemTest.java | 3 +- .../perf/scanner/suite/IssuesModeTest.java | 28 +------------------ 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java index a6c97d0ccee..e1ba5264111 100644 --- a/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java +++ b/tests/perf/src/test/java/org/sonarsource/sonarqube/perf/scanner/suite/FileSystemTest.java @@ -73,6 +73,7 @@ public class FileSystemTest extends PerfTestCase { private void run(int xmx, long expectedDuration) throws IOException { SonarRunner runner = SonarRunner.create() .setProperties( + "sonar.projectKey", "filesystemXmx" + xmx, "sonar.projectName", "filesystem xmx" + xmx, "sonar.projectVersion", "1.0", "sonar.sources", "src", @@ -83,7 +84,7 @@ public class FileSystemTest extends PerfTestCase { orchestrator.executeBuild(runner); - Properties prof = readProfiling(baseDir, "project"); + Properties prof = readProfiling(baseDir, "filesystemXmx" + xmx); perfRule.assertDurationAround(Long.valueOf(prof.getProperty("Index filesystem")), expectedDuration); } 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 cced5e65d13..3324c463bb2 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 @@ -68,32 +68,6 @@ public class IssuesModeTest extends PerfTestCase { long duration = System.currentTimeMillis() - start; System.out.println("Issues analysis: " + duration + "ms"); - perfRule.assertDurationAround(duration, 5230L); + perfRule.assertDurationAround(duration, 4200L); } - - @Test - public void issues_mode_with_cache_scan_xoo_project() throws IOException { - File userHome = temp.newFolder(); - orchestrator.getServer().provisionProject("sample", "xoo-sample"); - orchestrator.getServer().associateProjectToQualityProfile("sample", "xoo", "one-xoo-issue-per-line"); - SonarRunner runner = newScanner( - "-Xmx512m -server -XX:MaxPermSize=64m", - "sonar.analysis.mode", "issues", - "sonar.useWsCache", "true", - "sonar.userHome", userHome.getAbsolutePath(), - "sonar.showProfiling", "true"); - long start = System.currentTimeMillis(); - orchestrator.executeBuild(runner); - long firstDuration = System.currentTimeMillis() - start; - System.out.println("First issues analysis: " + firstDuration + "ms"); - - // caches are warmed - start = System.currentTimeMillis(); - orchestrator.executeBuild(runner); - long secondDuration = System.currentTimeMillis() - start; - System.out.println("Second issues analysis: " + secondDuration + "ms"); - - perfRule.assertDurationAround(secondDuration, 3350L); - } - } -- 2.39.5