diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-10-05 12:55:35 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-10-05 15:39:00 +0200 |
commit | a3caa98f84849143fa78f9fc286079e871b3c9dd (patch) | |
tree | 4deec6bf15632e570e10b35e6df5cd7340025017 /server/sonar-server-benchmarks | |
parent | bce3d38e9c99e156a8251f95cb437f3d54ee9a80 (diff) | |
download | sonarqube-a3caa98f84849143fa78f9fc286079e871b3c9dd.tar.gz sonarqube-a3caa98f84849143fa78f9fc286079e871b3c9dd.zip |
SONAR-6397 Do not read SCM info from db on first analysis
Diffstat (limited to 'server/sonar-server-benchmarks')
-rw-r--r-- | server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java index 87ad097dbab..09520d5b788 100644 --- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java +++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/PersistFileSourcesStepTest.java @@ -37,6 +37,7 @@ import org.sonar.batch.protocol.output.BatchReportWriter; import org.sonar.core.util.Uuids; import org.sonar.db.DbClient; import org.sonar.db.DbTester; +import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolderRule; import org.sonar.server.computation.batch.BatchReportDirectoryHolderImpl; import org.sonar.server.computation.batch.BatchReportReaderImpl; import org.sonar.server.computation.batch.TreeRootHolderRule; @@ -69,6 +70,9 @@ public class PersistFileSourcesStepTest { @Rule public TreeRootHolderRule treeRootHolder = new TreeRootHolderRule(); + @Rule + public MutableAnalysisMetadataHolderRule analysisMetadataHolder = new MutableAnalysisMetadataHolderRule(); + @Test public void benchmark() throws Exception { File reportDir = prepareReport(); @@ -85,7 +89,8 @@ public class PersistFileSourcesStepTest { batchReportDirectoryHolder.setDirectory(reportDir); org.sonar.server.computation.batch.BatchReportReader batchReportReader = new BatchReportReaderImpl(batchReportDirectoryHolder); SourceService sourceService = new SourceService(dbClient, null); - ScmInfoRepositoryImpl scmInfoRepository = new ScmInfoRepositoryImpl(batchReportReader, dbClient, sourceService); + analysisMetadataHolder.setIsFirstAnalysis(false); + ScmInfoRepositoryImpl scmInfoRepository = new ScmInfoRepositoryImpl(batchReportReader, analysisMetadataHolder, dbClient, sourceService); PersistFileSourcesStep step = new PersistFileSourcesStep(dbClient, System2.INSTANCE, treeRootHolder, batchReportReader, new SourceLinesRepositoryImpl(batchReportReader), scmInfoRepository); step.execute(); |