diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-01-18 09:59:30 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-01-18 15:52:57 +0100 |
commit | 0c0d3c3a54fd25fad64a3442dcc487d14932f2e2 (patch) | |
tree | 0ad50fe872bd817ff3a3a9dd9fa594eb5085ec4b /it | |
parent | 2e2a4f4ae1d052a93220a53aac849165971787ff (diff) | |
download | sonarqube-0c0d3c3a54fd25fad64a3442dcc487d14932f2e2.tar.gz sonarqube-0c0d3c3a54fd25fad64a3442dcc487d14932f2e2.zip |
fix DifferentialPeriodsTest instability
Diffstat (limited to 'it')
-rw-r--r-- | it/it-tests/src/test/java/it/measureHistory/DifferentialPeriodsTest.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/it/it-tests/src/test/java/it/measureHistory/DifferentialPeriodsTest.java b/it/it-tests/src/test/java/it/measureHistory/DifferentialPeriodsTest.java index 8ce2033931c..9c03b93052e 100644 --- a/it/it-tests/src/test/java/it/measureHistory/DifferentialPeriodsTest.java +++ b/it/it-tests/src/test/java/it/measureHistory/DifferentialPeriodsTest.java @@ -75,15 +75,16 @@ public class DifferentialPeriodsTest { setServerProperty(orchestrator, PROJECT_KEY, "sonar.timemachine.period4", "30"); setServerProperty(orchestrator, PROJECT_KEY, "sonar.timemachine.period5", "previous_analysis"); - // Execute an analysis in the past to have a past snapshot without any issues + // Execute an analysis 60 days ago to have a past snapshot without any issues orchestrator.getServer().associateProjectToQualityProfile(PROJECT_KEY, "xoo", "empty"); orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample")) .setProperty("sonar.projectDate", formatDate(addDays(new Date(), -60)))); - // Second analysis -> issues will be created + // Second analysis, 20 days ago, issues will be created orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/measureHistory/one-issue-per-line-profile.xml")); orchestrator.getServer().associateProjectToQualityProfile(PROJECT_KEY, "xoo", "one-issue-per-line"); - orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); + orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample")) + .setProperty("sonar.projectDate", formatDate(addDays(new Date(), -20)))); // New technical debt only comes from new issues Resource newTechnicalDebt = orchestrator.getServer().getWsClient() @@ -92,7 +93,7 @@ public class DifferentialPeriodsTest { assertThat(measures.get(0).getVariation4()).isEqualTo(17); assertThat(measures.get(0).getVariation5()).isEqualTo(17); - // Third analysis, with exactly the same profile -> no new issues so no new technical debt + // Third analysis, today, with exactly the same profile -> no new issues so no new technical debt orchestrator.getServer().associateProjectToQualityProfile(PROJECT_KEY, "xoo", "one-issue-per-line"); orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); |