Repository: 7mind/izumi
Pull request #860 (2020-01-28 05:02:00)

Update sbt-izumi to 0.0.47
Updates [io.7mind.izumi.sbt:sbt-izumi](https://github.com/7mind/sbtgen) [from 0.0.46 to 0.0.47](https://github.com/7mind/sbtgen/compare/v0.0.46...v0.0.47).
[Release Notes/Changelog](https://github.com/7mind/sbtgen/releases/tag/v0.0.47)

I'll automatically update this PR to resolve conflicts as long as you don't change it yourself.

If you'd like to skip this version, you can just close this PR. If you have any feedback, just mention me in the comments below.

Have a fantastic day writing Scala!

<details>
<summary>Ignore future updates</summary>

Add this to your `.scala-steward.conf` file to ignore future updates of this dependency:
```
updates.ignore = [ { groupId = "io.7mind.izumi.sbt", artifactId = "sbt-izumi" } ]
```
</details>

labels: sbt-plugin-update, semver-patch


Patch:
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 0dcb9c85a..71878a9ba 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,7 +1,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 
-addSbtPlugin("io.7mind.izumi.sbt" % "sbt-izumi" % "0.0.46")
+addSbtPlugin("io.7mind.izumi.sbt" % "sbt-izumi" % "0.0.47")
 
 addSbtPlugin("com.eed3si9n" % "sbt-assembly" % PV.sbt_assembly)
 


Test patch:
diff --git a/distage/distage-testkit-scalatest/src/main/scala/izumi/distage/testkit/services/scalatest/dstest/DistageTestsRegistrySingleton.scala b/distage/distage-testkit-scalatest/src/main/scala/izumi/distage/testkit/services/scalatest/dstest/DistageTestsRegistrySingleton.scala
index 190fd7fbb..d753db1fa 100644
--- a/distage/distage-testkit-scalatest/src/main/scala/izumi/distage/testkit/services/scalatest/dstest/DistageTestsRegistrySingleton.scala
+++ b/distage/distage-testkit-scalatest/src/main/scala/izumi/distage/testkit/services/scalatest/dstest/DistageTestsRegistrySingleton.scala
@@ -7,16 +7,18 @@ import distage.{SafeType, TagK}
 import izumi.distage.testkit.services.dstest.DistageTestRunner.DistageTest
 import izumi.functional.Value
 import izumi.fundamentals.platform.language.Quirks._
-import org.scalatest.{StatefulStatus, Tracker}
+import org.scalatest.{Reporter, StatefulStatus, Tracker}
 
 import scala.collection.mutable
 
 object DistageTestsRegistrySingleton {
+  final case class SuiteReporter(tracker: Tracker, reporter: Reporter)
+
   protected[this] type Fake[T]
   private[this] object Fake
   private[this] val registry = new mutable.HashMap[SafeType, mutable.ArrayBuffer[DistageTest[Fake]]]()
   private[this] val statuses = new mutable.HashMap[SafeType, Option[mutable.HashMap[String, StatefulStatus]]]()
-  private[this] val trackers = new mutable.HashMap[String, Either[mutable.ArrayBuffer[Tracker => Unit], Tracker]]()
+  private[this] val suiteReporters = new mutable.HashMap[String, Either[mutable.ArrayBuffer[SuiteReporter => Unit], SuiteReporter]]()
   private[this] val runTracker = new ConcurrentHashMap[SafeType, Fake.type]()
   private[this] val knownSuites = new ConcurrentHashMap[(SafeType, String), Fake.type]()
   private[this] val registrationOpen = new AtomicBoolean(true)
@@ -64,33 +66,31 @@ object DistageTestsRegistrySingleton {
   }
 
   def completeStatuses[F[_]: TagK](): Unit = synchronized {
-    statuses.get(SafeType.getK[F])
-      .flatten
-      .foreach {
-        _.valuesIterator.foreach {
-          status =>
-            if (!status.isCompleted) {
-              status.setCompleted()
-            }
-        }
+    statuses.get(SafeType.getK[F]).flatten.foreach {
+      _.valuesIterator.foreach {
+        status =>
+          if (!status.isCompleted) {
+            status.setCompleted()
+          }
       }
+    }
     statuses.put(SafeType.getK[F], None).discard()
   }
 
-  def runReport(suiteId: String)(f: Tracker => Unit): Unit = synchronized {
-    trackers.getOrElseUpdate(suiteId, Left(mutable.ArrayBuffer.empty)) match {
+  def runReport(suiteId: String)(f: SuiteReporter => Unit): Unit = synchronized {
+    suiteReporters.getOrElseUpdate(suiteId, Left(mutable.ArrayBuffer.empty)) match {
       case Left(reports) =>
         (reports += f).discard()
-      case Right(tracker) =>
-        f(tracker)
+      case Right(suiteReporter) =>
+        f(suiteReporter)
     }
   }
 
-  def registerTracker(suiteId: String)(tracker: Tracker): Unit = synchronized {
-    trackers.getOrElseUpdate(suiteId, Right(tracker)) match {
+  def registerSuiteReporter(suiteId: String)(suiteReporter: SuiteReporter): Unit = synchronized {
+    suiteReporters.getOrElseUpdate(suiteId, Right(suiteReporter)) match {
       case Left(reports) =>
-        trackers(suiteId) = Right(tracker)
-        reports.foreach(_.apply(tracker))
+        suiteReporters(suiteId) = Right(suiteReporter)
+        reports.foreach(_.apply(suiteReporter))
       case Right(_) =>
     }
   }
diff --git a/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/ScalatestReporter.scala b/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/DistageScalatestReporter.scala
similarity index 95%
rename from distage/distage-testkit-scalatest/src/main/scala/org/scalatest/ScalatestReporter.scala
rename to distage/distage-testkit-scalatest/src/main/scala/org/scalatest/DistageScalatestReporter.scala
index 9b0c70e00..fa6ff71e5 100644
--- a/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/ScalatestReporter.scala
+++ b/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/DistageScalatestReporter.scala
@@ -7,7 +7,7 @@ import izumi.fundamentals.platform.strings.IzString._
 import org.scalatest.Suite.getIndentedTextForTest
 import org.scalatest.events._
 
-class ScalatestReporter(reporter: Reporter) extends TestReporter {
+class DistageScalatestReporter extends TestReporter {
 
   override def onFailure(f: Throwable): Unit = {
     System.err.println("Test runner failed")
@@ -108,7 +108,7 @@ class ScalatestReporter(reporter: Reporter) extends TestReporter {
   }
 
   @inline private[this] def doReport(suiteId: String)(f: Ordinal => Event): Unit = {
-    DistageTestsRegistrySingleton.runReport(suiteId)(tracker => reporter(f(tracker.nextOrdinal())))
+    DistageTestsRegistrySingleton.runReport(suiteId)(sr => sr.reporter(f(sr.tracker.nextOrdinal())))
   }
 
 }
diff --git a/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/DistageScalatestTestSuiteRunner.scala b/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/DistageScalatestTestSuiteRunner.scala
index 56ad0a58a..eea435b6f 100644
--- a/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/DistageScalatestTestSuiteRunner.scala
+++ b/distage/distage-testkit-scalatest/src/main/scala/org/scalatest/DistageScalatestTestSuiteRunner.scala
@@ -9,6 +9,7 @@ import izumi.distage.testkit.{DebugProperties, SpecConfig}
 import izumi.distage.testkit.services.dstest.DistageTestRunner._
 import izumi.distage.testkit.services.dstest.{AbstractDistageSpec, DistageTestRunner, SpecEnvironment}
 import izumi.distage.testkit.services.scalatest.dstest.DistageTestsRegistrySingleton
+import izumi.distage.testkit.services.scalatest.dstest.DistageTestsRegistrySingleton.SuiteReporter
 import izumi.fundamentals.platform.console.TrivialLogger
 import izumi.fundamentals.platform.functional.Identity
 import izumi.logstage.api.{IzLogger, Log}
@@ -94,7 +95,7 @@ abstract class DistageScalatestTestSuiteRunner[F[_]](implicit override val tagMo
   override protected final def runTest(testName: String, args: Args): Status = throw new UnsupportedOperationException
 
   override def run(testName: Option[String], args: Args): Status = {
-    DistageTestsRegistrySingleton.registerTracker(suiteId)(args.tracker)
+    DistageTestsRegistrySingleton.registerSuiteReporter(suiteId)(SuiteReporter(args.tracker, args.reporter))
     // If, we're running under sbt, scan the classpath manually to add all tests
     // in neighboring packages before starting anything, because sbt runner
     // instantiates & runs tests at the same time, so when `run` is called
@@ -210,7 +211,7 @@ abstract class DistageScalatestTestSuiteRunner[F[_]](implicit override val tagMo
   protected def parallelEnvExecution: Boolean = true
 
   private def mkTestReporter(args: Args): TestReporter = {
-    val scalatestReporter = new ScalatestReporter(args.reporter)
+    val scalatestReporter = new DistageScalatestReporter
     new SafeTestReporter(scalatestReporter)
   }