Add missing @UseLocalDisk annotation in BotLikeExtractorImplSpec The BotLikeExtractorImplSpec test was missing the @UseLocalDisk triggering the creation of a Gerrit site with an in-memory repository manager. The all analytics plugin assumes the repositories are stored on disk therefore the text execution, if run as first test, was triggering the creation of a static daemon that broke all assertions of having a FileRepository. Example of a failure noticed on the CI: java.lang.IllegalStateException: Expected 'FileRepository', got com.google.gerrit.testing.InMemoryRepositoryManager$Repo at com.googlesource.gerrit.plugins.analytics.test.GerritTestDaemon$.getRepository(GerritTestDaemon.scala:166) at com.googlesource.gerrit.plugins.analytics.test.GerritTestDaemon.beforeEach(GerritTestDaemon.scala:77) at com.googlesource.gerrit.plugins.analytics.test.GerritTestDaemon.beforeEach$(GerritTestDaemon.scala:74) at com.googlesource.gerrit.plugins.analytics.test.CommitStatisticsSpec.beforeEach(CommitStatisticsSpec.scala:26) Add the missing @UseLocalDisk annotation and make the analytics tests more resilient to tests execution order. Change-Id: Ia8801071b7fabfa17e8036f7b6eb3175d7cf555e
diff --git a/src/test/scala/com/googlesource/gerrit/plugins/analytics/common/BotLikeExtractorImplSpec.scala b/src/test/scala/com/googlesource/gerrit/plugins/analytics/common/BotLikeExtractorImplSpec.scala index 83e3871..0871b41 100644 --- a/src/test/scala/com/googlesource/gerrit/plugins/analytics/common/BotLikeExtractorImplSpec.scala +++ b/src/test/scala/com/googlesource/gerrit/plugins/analytics/common/BotLikeExtractorImplSpec.scala
@@ -14,11 +14,13 @@ package com.googlesource.gerrit.plugins.analytics.common +import com.google.gerrit.acceptance.UseLocalDisk import com.googlesource.gerrit.plugins.analytics.AnalyticsConfig import com.googlesource.gerrit.plugins.analytics.test.GerritTestDaemon import org.scalatest.flatspec.AnyFlatSpecLike import org.scalatest.matchers.should.Matchers +@UseLocalDisk class BotLikeExtractorImplSpec extends AnyFlatSpecLike with Matchers with GerritTestDaemon { behavior of "isBotLike"