aboutsummaryrefslogtreecommitdiffstats
path: root/it
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-05-23 13:36:18 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-05-23 14:44:20 +0200
commit453c48fd22f93a800f7f54645429b35c1736e482 (patch)
treef2333bcdc7d8e007bb93ef86ba1d6158a86d1388 /it
parenteb9621b54f37ece61b71ffbbdc3b9d14430a4330 (diff)
downloadsonarqube-453c48fd22f93a800f7f54645429b35c1736e482.tar.gz
sonarqube-453c48fd22f93a800f7f54645429b35c1736e482.zip
SONAR-7175 Fix IT
Diffstat (limited to 'it')
-rw-r--r--it/it-tests/src/test/java/it/dbCleaner/PurgeTest.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/it/it-tests/src/test/java/it/dbCleaner/PurgeTest.java b/it/it-tests/src/test/java/it/dbCleaner/PurgeTest.java
index d2040c301ae..0278e76396c 100644
--- a/it/it-tests/src/test/java/it/dbCleaner/PurgeTest.java
+++ b/it/it-tests/src/test/java/it/dbCleaner/PurgeTest.java
@@ -176,29 +176,29 @@ public class PurgeTest {
// Keep all snapshots from last 4 weeks
setServerProperty(orchestrator, "sonar.dbcleaner.weeksBeforeKeepingOnlyOneSnapshotByWeek", "4");
+ // Execute an analysis 11 days ago
+ String elevenDaysAgo = formatDate(addDays(new Date(), -11));
+ runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH, "sonar.projectDate", elevenDaysAgo);
+
// Execute an analysis 10 days ago
String tenDaysAgo = formatDate(addDays(new Date(), -10));
runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH, "sonar.projectDate", tenDaysAgo);
- // Execute an analysis 8 days ago
- String eightDaysAgo = formatDate(addDays(new Date(), -8));
- runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH, "sonar.projectDate", eightDaysAgo);
-
// Now only keep 1 snapshot per week
setServerProperty(orchestrator, "sonar.dbcleaner.weeksBeforeKeepingOnlyOneSnapshotByWeek", "0");
// Execute an analysis today to execute the purge of previous weeks snapshots
runProjectAnalysis(orchestrator, PROJECT_SAMPLE_PATH);
- // Check that only analysis from 8 days ago is kept (as it's the last one from previous week)
+ // Check that only analysis from 10 days ago is kept (as it's the last one from previous week)
WsResponse response = newAdminWsClient(orchestrator).wsConnector().call(
new GetRequest("/api/timemachine/index")
.setParam("resource", PROJECT_KEY)
.setParam("metrics", "ncloc"))
.failIfNotSuccessful();
String content = response.content();
- assertThat(content).contains(eightDaysAgo);
- assertThat(content).doesNotContain(tenDaysAgo);
+ assertThat(content).contains(tenDaysAgo);
+ assertThat(content).doesNotContain(elevenDaysAgo);
}
/**