Repository: 7mind/izumi
Pull request #907 (2020-02-19 14:14:09)

Remove deprecated `distage-testkit-legacy` module, please migrate to `distage-testkit-scalatest`
* remove `ClassLoaderLayeringStrategy.Flat` in `distage-testkit-core`/`scalatest` tests, doesn't seem necessary anymore


Patch:
diff --git a/build.sbt b/build.sbt
index 4020960a6..9eb1a1582 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1611,7 +1611,6 @@ lazy val `distage-testkit-core` = project.in(file("distage/distage-testkit-core"
     unmanagedResourceDirectories in Compile += baseDirectory.value / ".jvm/src/main/resources" ,
     unmanagedSourceDirectories in Test += baseDirectory.value / ".jvm/src/test/scala" ,
     unmanagedResourceDirectories in Test += baseDirectory.value / ".jvm/src/test/resources" ,
-    classLoaderLayeringStrategy in Test := ClassLoaderLayeringStrategy.Flat,
     scalacOptions ++= Seq(
       s"-Xmacro-settings:scala-version=${scalaVersion.value}",
       s"-Xmacro-settings:scala-versions=${crossScalaVersions.value.mkString(":")}"
@@ -1713,111 +1712,6 @@ lazy val `distage-testkit-scalatest` = project.in(file("distage/distage-testkit-
     unmanagedResourceDirectories in Compile += baseDirectory.value / ".jvm/src/main/resources" ,
     unmanagedSourceDirectories in Test += baseDirectory.value / ".jvm/src/test/scala" ,
     unmanagedResourceDirectories in Test += baseDirectory.value / ".jvm/src/test/resources" ,
-    classLoaderLayeringStrategy in Test := ClassLoaderLayeringStrategy.Flat,
-    scalacOptions ++= Seq(
-      s"-Xmacro-settings:scala-version=${scalaVersion.value}",
-      s"-Xmacro-settings:scala-versions=${crossScalaVersions.value.mkString(":")}"
-    ),
-    testOptions in Test += Tests.Argument("-oDF"),
-    scalacOptions ++= { (isSnapshot.value, scalaVersion.value) match {
-      case (_, "2.12.10") => Seq(
-        "-Xsource:2.13",
-        "-Ybackend-parallelism",
-        math.min(16, math.max(1, sys.runtime.availableProcessors() - 1)).toString,
-        "-Ypartial-unification",
-        "-Yno-adapted-args",
-        "-Xlint:adapted-args",
-        "-Xlint:by-name-right-associative",
-        "-Xlint:constant",
-        "-Xlint:delayedinit-select",
-        "-Xlint:doc-detached",
-        "-Xlint:inaccessible",
-        "-Xlint:infer-any",
-        "-Xlint:missing-interpolator",
-        "-Xlint:nullary-override",
-        "-Xlint:nullary-unit",
-        "-Xlint:option-implicit",
-        "-Xlint:package-object-classes",
-        "-Xlint:poly-implicit-overload",
-        "-Xlint:private-shadow",
-        "-Xlint:stars-align",
-        "-Xlint:type-parameter-shadow",
-        "-Xlint:unsound-match",
-        "-opt-warnings:_",
-        "-Ywarn-extra-implicit",
-        "-Ywarn-unused:_",
-        "-Ywarn-adapted-args",
-        "-Ywarn-dead-code",
-        "-Ywarn-inaccessible",
-        "-Ywarn-infer-any",
-        "-Ywarn-nullary-override",
-        "-Ywarn-nullary-unit",
-        "-Ywarn-numeric-widen",
-        "-Ywarn-unused-import",
-        "-Ywarn-value-discard",
-        "-Ycache-plugin-class-loader:always",
-        "-Ycache-macro-class-loader:last-modified"
-      )
-      case (_, "2.13.1") => Seq(
-        "-Xlint:_,-eta-sam",
-        "-Ybackend-parallelism",
-        math.min(16, math.max(1, sys.runtime.availableProcessors() - 1)).toString,
-        "-Wdead-code",
-        "-Wextra-implicit",
-        "-Wnumeric-widen",
-        "-Woctal-literal",
-        "-Wunused:_",
-        "-Wvalue-discard",
-        "-Ycache-plugin-class-loader:always",
-        "-Ycache-macro-class-loader:last-modified"
-      )
-      case (_, _) => Seq.empty
-    } },
-    scalacOptions ++= { (isSnapshot.value, scalaVersion.value) match {
-      case (false, "2.12.10") => Seq(
-        "-opt:l:inline",
-        "-opt-inline-from:izumi.**"
-      )
-      case (false, "2.13.1") => Seq(
-        "-opt:l:inline",
-        "-opt-inline-from:izumi.**"
-      )
-      case (_, _) => Seq.empty
-    } },
-    scalaVersion := crossScalaVersions.value.head,
-    crossScalaVersions := Seq(
-      "2.12.10",
-      "2.13.1"
-    )
-  )
-  .disablePlugins(AssemblyPlugin)
-
-lazy val `distage-testkit-legacy` = project.in(file("distage/distage-testkit-legacy"))
-  .dependsOn(
-    `distage-extension-config` % "test->compile;compile->compile",
-    `distage-framework` % "test->compile;compile->compile",
-    `distage-extension-logstage` % "test->compile;compile->compile",
-    `distage-core` % "test->compile;compile->compile",
-    `distage-testkit-core` % "test->compile;compile->compile"
-  )
-  .settings(
-    libraryDependencies ++= Seq(
-      compilerPlugin("org.typelevel" % "kind-projector" % V.kind_projector cross CrossVersion.full),
-      "org.scala-lang.modules" %% "scala-collection-compat" % V.collection_compat,
-      "org.scalatest" %% "scalatest" % V.scalatest % Test,
-      "org.typelevel" %% "cats-core" % V.cats % Optional,
-      "org.typelevel" %% "cats-effect" % V.cats_effect % Optional,
-      "dev.zio" %% "zio" % V.zio % Optional,
-      "org.scalatest" %% "scalatest" % V.scalatest
-    )
-  )
-  .settings(
-    organization := "io.7mind.izumi",
-    unmanagedSourceDirectories in Compile += baseDirectory.value / ".jvm/src/main/scala" ,
-    unmanagedResourceDirectories in Compile += baseDirectory.value / ".jvm/src/main/resources" ,
-    unmanagedSourceDirectories in Test += baseDirectory.value / ".jvm/src/test/scala" ,
-    unmanagedResourceDirectories in Test += baseDirectory.value / ".jvm/src/test/resources" ,
-    classLoaderLayeringStrategy in Test := ClassLoaderLayeringStrategy.Flat,
     scalacOptions ++= Seq(
       s"-Xmacro-settings:scala-version=${scalaVersion.value}",
       s"-Xmacro-settings:scala-versions=${crossScalaVersions.value.mkString(":")}"
@@ -2311,7 +2205,6 @@ lazy val `microsite` = project.in(file("doc/microsite"))
     `distage-framework-docker` % "test->compile;compile->compile",
     `distage-testkit-core` % "test->compile;compile->compile",
     `distage-testkit-scalatest` % "test->compile;compile->compile",
-    `distage-testkit-legacy` % "test->compile;compile->compile",
     `logstage-core` % "test->compile;compile->compile",
     `logstage-rendering-circe` % "test->compile;compile->compile",
     `logstage-adapter-slf4j` % "test->compile;compile->compile",
@@ -2612,8 +2505,7 @@ lazy val `distage` = (project in file(".agg/distage-distage"))
     `distage-framework`,
     `distage-framework-docker`,
     `distage-testkit-core`,
-    `distage-testkit-scalatest`,
-    `distage-testkit-legacy`
+    `distage-testkit-scalatest`
   )
 
 lazy val `distage-jvm` = (project in file(".agg/distage-distage-jvm"))
@@ -2637,8 +2529,7 @@ lazy val `distage-jvm` = (project in file(".agg/distage-distage-jvm"))
     `distage-framework`,
     `distage-framework-docker`,
     `distage-testkit-core`,
-    `distage-testkit-scalatest`,
-    `distage-testkit-legacy`
+    `distage-testkit-scalatest`
   )
 
 lazy val `logstage` = (project in file(".agg/logstage-logstage"))
diff --git a/distage/distage-core/src/main/scala/izumi/distage/bootstrap/DebugProperties.scala b/distage/distage-core/src/main/scala/izumi/distage/bootstrap/DebugProperties.scala
new file mode 100644
index 000000000..a177e8473
--- /dev/null
+++ b/distage/distage-core/src/main/scala/izumi/distage/bootstrap/DebugProperties.scala
@@ -0,0 +1,8 @@
+package izumi.distage.bootstrap
+
+import izumi.fundamentals.platform.properties
+
+object DebugProperties extends properties.DebugProperties {
+  /** Print debug messages when planning Injector's own bootstrap environment */
+  final val `izumi.distage.debug.bootstrap` = "izumi.distage.debug.bootstrap"
+}
diff --git a/project/Deps.sc b/project/Deps.sc
index 29b0fe2ff..c89917610 100644
--- a/project/Deps.sc
+++ b/project/Deps.sc
@@ -292,7 +292,6 @@ object Izumi {
       final lazy val framework = ArtifactId("distage-framework")
       final lazy val testkitCore = ArtifactId("distage-testkit-core")
       final lazy val testkitScalatest = ArtifactId("distage-testkit-scalatest")
-      final lazy val legacyTestkit = ArtifactId("distage-testkit-legacy")
       final lazy val logging = ArtifactId("distage-extension-logstage")
     }
 
@@ -481,9 +480,6 @@ object Izumi {
         depends =
           Seq(Projects.distage.config, Projects.distage.framework, Projects.distage.logging).map(_ in Scope.Compile.all) ++
             Seq(Projects.distage.core).map(_ tin Scope.Compile.all),
-        settings = Seq(
-          "classLoaderLayeringStrategy" in SettingScope.Test := "ClassLoaderLayeringStrategy.Flat".raw,
-        ),
         platforms = Targets.jvm,
       ),
       Artifact(
@@ -492,20 +488,6 @@ object Izumi {
         depends =
           Seq(Projects.distage.testkitCore).map(_ in Scope.Compile.all) ++
             Seq(Projects.distage.core, Projects.distage.plugins).map(_ tin Scope.Compile.all),
-        settings = Seq(
-          "classLoaderLayeringStrategy" in SettingScope.Test := "ClassLoaderLayeringStrategy.Flat".raw,
-        ),
-        platforms = Targets.jvm,
-      ),
-      Artifact(
-        name = Projects.distage.legacyTestkit,
-        libs = allMonadsOptional ++ Seq(scalatest.dependency).map(_ in Scope.Compile.all),
-        depends =
-          Seq(Projects.distage.config, Projects.distage.framework, Projects.distage.logging).map(_ in Scope.Compile.all) ++
-            Seq(Projects.distage.core, Projects.distage.testkitCore).map(_ in Scope.Compile.all),
-        settings = Seq(
-          "classLoaderLayeringStrategy" in SettingScope.Test := "ClassLoaderLayeringStrategy.Flat".raw,
-        ),
         platforms = Targets.jvm,
       ),
     ),


Test patch:
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/DistageBioSpec.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/DistageBioSpec.scala
deleted file mode 100644
index fb15ec27d..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/DistageBioSpec.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-package izumi.distage.testkit
-
-import distage.TagKK
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class DistageBioSpec[F[_, _]](implicit val tagBIO: TagKK[F]) extends DistageSpec[F[Throwable, ?]]
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/DistageSpec.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/DistageSpec.scala
deleted file mode 100644
index 99cca3095..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/DistageSpec.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-package izumi.distage.testkit
-
-import izumi.distage.testkit.services.scalatest.adapter.DistageTestSupport
-import izumi.fundamentals.reflection.Tags.TagK
-import org.scalatest.ScalatestSuite
-import org.scalatest.wordspec.AnyWordSpecLike
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class DistageSpec[F[_]: TagK] extends DistageTestSupport[F] with AnyWordSpecLike {
-  override def toString: String = ScalatestSuite.suiteToString(None, this)
-}
-
-
-
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/BootstrapConfig.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/BootstrapConfig.scala
deleted file mode 100644
index 5355571fe..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/BootstrapConfig.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import izumi.distage.plugins.PluginConfig
-
-@deprecated("Use dstest", "2019/Jul/18")
-final case class BootstrapConfig(
-                                  pluginConfig: PluginConfig,
-                                  bootstrapPluginConfig: Option[PluginConfig],
-                                )
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DISyntax.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DISyntax.scala
deleted file mode 100644
index 39f2249d9..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DISyntax.scala
+++ /dev/null
@@ -1,27 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import izumi.distage.model.providers.ProviderMagnet
-import izumi.distage.testkit.services.DISyntaxBase
-import distage.Tag
-import izumi.fundamentals.platform.language.CodePositionMaterializer
-
-@deprecated("Use dstest", "2019/Jul/18")
-trait DISyntax[F[_]] extends DISyntaxBase[F] {
-
-  final def dio(function: ProviderMagnet[F[_]])(implicit pos: CodePositionMaterializer): Unit = {
-    takeIO(function, pos.get)
-  }
-
-  final def dio[T: Tag](function: T => F[_])(implicit pos: CodePositionMaterializer): Unit = {
-    takeFunIO(function, pos.get)
-  }
-
-  final def di[T: Tag](function: T => Any)(implicit pos: CodePositionMaterializer): Unit = {
-    takeFunAny(function, pos.get)
-  }
-
-  final def di(function: ProviderMagnet[Any])(implicit pos: CodePositionMaterializer): Unit = {
-    takeAny(function, pos.get)
-  }
-
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DISyntaxBIO.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DISyntaxBIO.scala
deleted file mode 100644
index b842ae192..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DISyntaxBIO.scala
+++ /dev/null
@@ -1,19 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import distage.Tag
-import izumi.distage.model.providers.ProviderMagnet
-import izumi.distage.testkit.services.DISyntaxBIOBase
-import izumi.fundamentals.platform.language.CodePositionMaterializer
-
-@deprecated("Use dstest", "2019/Jul/18")
-trait DISyntaxBIO[F[+ _, + _]] extends DISyntaxBIOBase[F] {
-
-  final def dio(function: ProviderMagnet[F[_, _]])(implicit pos: CodePositionMaterializer, dummyImplicit: DummyImplicit): Unit = {
-    takeBIO(function, pos.get)
-  }
-
-  final def dio[T: Tag](function: T => F[_, _])(implicit pos: CodePositionMaterializer, dummyImplicit: DummyImplicit): Unit = {
-    takeFunBIO(function, pos.get)
-  }
-
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DistagePluginTestSupport.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DistagePluginTestSupport.scala
deleted file mode 100644
index aed5a0da9..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DistagePluginTestSupport.scala
+++ /dev/null
@@ -1,56 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import distage.SafeType
-import izumi.distage.model.definition.Activation
-import izumi.distage.model.definition.StandardAxis._
-import izumi.distage.plugins.PluginConfig
-import izumi.distage.testkit.TestConfig
-import izumi.distage.testkit.services.dstest.{DistageTestEnv, TestEnvironment}
-import izumi.fundamentals.reflection.Tags.TagK
-import izumi.logstage.api.IzLogger
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class DistagePluginTestSupport[F[_] : TagK] extends DistageTestSupport[F] with DistageTestEnv {
-
-  /**
-    * This may be used as an implementation of [[pluginPackages]] in simple cases.
-    *
-    * Though it has to be always explicitly specified because this behaviour applied by default
-    * would be very obscure.
-    */
-  protected final def thisPackage: Seq[String] = {
-    Seq(this.getClass.getPackage.getName)
-  }
-
-  protected def pluginPackages: Seq[String]
-
-  protected def pluginBootstrapPackages: Option[Seq[String]] = None
-
-  override final def loadEnvironment(logger: IzLogger): TestEnvironment = {
-    val config = TestConfig(
-      bootstrapConfig.pluginConfig,
-      bootstrapConfig.bootstrapPluginConfig.getOrElse(PluginConfig.empty),
-      activation
-    )
-    loadEnvironment(logger, config)
-  }
-
-  protected def activation: Activation = {
-    Activation(Env -> Env.Test)
-  }
-
-  protected def memoizationContextId: MemoizationContextId = {
-    MemoizationContextId.PerRuntimeAndActivationAndBsconfig[F](bootstrapConfig, activation, SafeType.getK[F])
-  }
-
-  protected def bootstrapConfig: BootstrapConfig = {
-    BootstrapConfig(
-      pluginConfig = PluginConfig.cached(pluginPackages),
-      bootstrapPluginConfig = pluginBootstrapPackages.map(p => PluginConfig.cached(p)),
-    )
-  }
-
-}
-
-
-
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DistageTestSupport.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DistageTestSupport.scala
deleted file mode 100644
index db986c90e..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/DistageTestSupport.scala
+++ /dev/null
@@ -1,189 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import distage.config.AppConfig
-import distage.{DIKey, Injector, ModuleBase}
-import izumi.distage.framework.config.PlanningOptions
-import izumi.distage.framework.model.ActivationInfo
-import izumi.distage.framework.model.exceptions.IntegrationCheckException
-import izumi.distage.framework.services.{ConfigLoader, IntegrationChecker, ModuleProvider, RoleAppPlanner}
-import izumi.distage.model.{Locator, PlannerInput}
-import izumi.distage.model.definition.Binding.SingletonBinding
-import izumi.distage.model.definition.{Activation, Binding, BootstrapModule, ImplDef, Module}
-import izumi.distage.model.effect.DIEffect
-import izumi.distage.model.effect.DIEffect.syntax._
-import izumi.distage.model.providers.ProviderMagnet
-import izumi.distage.model.recursive.Bootloader
-import izumi.distage.roles.model.meta.RolesInfo
-import izumi.distage.roles.services.StartupPlanExecutor.Filters
-import izumi.distage.roles.services._
-import izumi.distage.testkit.services.dstest.TestEnvironment
-import izumi.distage.testkit.services.scalatest.adapter.ExternalResourceProvider.{MemoizedInstance, OrderedFinalizer, PreparedShutdownRuntime}
-import izumi.fundamentals.platform.cli.model.raw.RawAppArgs
-import izumi.fundamentals.platform.functional.Identity
-import izumi.fundamentals.platform.language.{CodePosition, unused}
-import izumi.fundamentals.reflection.Tags.TagK
-import izumi.logstage.api.IzLogger
-import izumi.logstage.api.Log.Level
-import izumi.logstage.api.logger.LogRouter
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class DistageTestSupport[F[_]](implicit val tagK: TagK[F])
-  extends DISyntax[F]
-    with IgnoreSupport
-    with SuppressionSupport {
-
-  private lazy val erpInstance = externalResourceProvider
-
-  protected def externalResourceProvider: ExternalResourceProvider = ExternalResourceProvider.Null
-
-  protected def memoizationContextId: MemoizationContextId
-
-  protected final def doMemoize(locator: Locator): Unit = {
-    val fmap = locator.finalizers[F].zipWithIndex.map {
-      case (f, idx) =>
-        f.key -> OrderedFinalizer(f, idx)
-    }.toMap
-    locator
-      .allInstances
-      .foreach {
-        ref =>
-          externalResourceProvider.process(memoizationContextId, MemoizedInstance[Any](ref, fmap.get(ref.key)))
-      }
-  }
-
-  override protected def takeIO(function: ProviderMagnet[F[_]], @unused pos: CodePosition): Unit = {
-    verifyTotalSuppression()
-
-    val logger = makeLogger()
-    val loader = makeConfigLoader(logger)
-    val env = loadEnvironment(logger)
-    val config = loader.buildConfig()
-    val options = contextOptions()
-    val provider = makeModuleProvider(options, config, logger.router, env.roles, env.activationInfo, env.activation)
-
-    val bsModule = provider.bootstrapModules().merge overridenBy env.bsModule overridenBy bootstrapOverride
-    val appModule = provider.appModules().merge overridenBy env.appModule
-
-    val allRoots = function.get.diKeys.toSet ++ additionalRoots
-
-    val refinedBindings = refineBindings(allRoots, appModule)
-    val withMemoized = applyMemoization(refinedBindings)
-    val planner = makePlanner(options, bsModule, logger, Injector.bootloader(PlannerInput(withMemoized overridenBy appOverride, allRoots)))
-
-    val plan = planner.makePlan(allRoots)
-
-    erpInstance.registerShutdownRuntime[F](PreparedShutdownRuntime[F](
-      plan.injector.produceF[Identity](plan.runtime)
-    ))
-
-    val filters = Filters[F](
-      _.filterNot(f => erpInstance.isMemoized(memoizationContextId, f.key)),
-      _.filterNot(f => erpInstance.isMemoized(memoizationContextId, f.key)),
-    )
-
-    verifyTotalSuppression()
-    try {
-      makeExecutor(plan.injector, logger)
-        .execute(plan, filters) {
-          (locator, effect) =>
-            implicit val F: DIEffect[F] = effect
-
-            for {
-              _ <- F.maybeSuspend(doMemoize(locator))
-              _ <- F.maybeSuspend(verifyTotalSuppression())
-              _ <- F.maybeSuspend(beforeRun(locator))
-              _ <- F.maybeSuspend(verifyTotalSuppression())
-              _ <- locator.run(function)
-            } yield ()
-        }
-    } catch {
-      case i: IntegrationCheckException =>
-        suppressTheRestOfTestSuite()
-        ignoreThisTest(Some(i.getMessage), Option(i.getCause))
-    } finally {
-      val cacheSize = erpInstance.size(memoizationContextId)
-      if (cacheSize > 0) {
-        logger.info(s"${cacheSize -> "memoized instances"} in ${memoizationContextId -> "memoization context"}")
-      }
-    }
-  }
-
-  protected def bootstrapOverride: BootstrapModule = BootstrapModule.empty
-
-  protected def appOverride: ModuleBase = Module.empty
-
-  protected final def applyMemoization(refinedBindings: ModuleBase): ModuleBase = {
-    refinedBindings.map {
-      b =>
-        erpInstance.getMemoized(memoizationContextId, b.key) match {
-          case Some(value) =>
-            val impltype = b match {
-              case binding: Binding.ImplBinding =>
-                binding.implementation.implType
-              case binding: Binding.SetBinding =>
-                binding match {
-                  case e: Binding.SetElementBinding =>
-                    e.implementation.implType
-                  case s: Binding.EmptySetBinding[_] =>
-                    s.key.tpe
-                }
-            }
-            val impl = ImplDef.InstanceImpl(impltype, value)
-            SingletonBinding(b.key, impl, b.tags, b.origin)
-
-          case None =>
-            b
-        }
-
-    }
-  }
-
-  protected def loadEnvironment(logger: IzLogger): TestEnvironment
-
-  protected def bootstrapLogLevel: Level = IzLogger.Level.Warn
-
-  protected def additionalRoots: Set[DIKey] = Set.empty
-
-  protected def makeLogger(): IzLogger = IzLogger(bootstrapLogLevel)("phase" -> "test")
-
-  protected def makeModuleProvider(options: PlanningOptions, config: AppConfig, logRouter: LogRouter, roles: RolesInfo, activationInfo: ActivationInfo, activation: Activation): ModuleProvider = {
-    // roles descriptor is not actually required there, we bind it just in case someone wish to inject a class depending on it
-    new ModuleProvider.Impl[F](
-      logRouter = logRouter,
-      config = config,
-      roles = roles,
-      options = options,
-      args = RawAppArgs.empty,
-      activationInfo = activationInfo,
-      activation = activation,
-    )
-  }
-
-  protected def contextOptions(): PlanningOptions = PlanningOptions()
-
-  protected def makePlanner(options: PlanningOptions, bsModule: BootstrapModule, logger: IzLogger, reboot: Bootloader): RoleAppPlanner[F] = {
-    new RoleAppPlanner.Impl[F](options, bsModule, logger, reboot)
-  }
-
-  protected def makeExecutor(injector: Injector, logger: IzLogger): StartupPlanExecutor[F] = {
-    StartupPlanExecutor(injector, new IntegrationChecker.Impl[F](logger))
-  }
-
-  /** You can override this to e.g. skip test when certain external dependencies are not available **/
-  protected def beforeRun(@unused context: Locator): Unit = {}
-
-  protected def makeConfigLoader(logger: IzLogger): ConfigLoader = {
-    val thisClass = this.getClass
-    val pname = s"${thisClass.getPackage.getName}"
-    val lastPackage = pname.split('.').last
-    val classname = thisClass.getName
-
-    val moreConfigs = Map(
-      s"$lastPackage-test" -> None,
-      s"$classname-test" -> None,
-    )
-    new ConfigLoader.LocalFSImpl(logger, None, moreConfigs)
-  }
-
-  protected def refineBindings(@unused roots: Set[DIKey], primaryModule: ModuleBase): ModuleBase = primaryModule
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/ExternalResourceProvider.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/ExternalResourceProvider.scala
deleted file mode 100644
index a70099fb2..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/ExternalResourceProvider.scala
+++ /dev/null
@@ -1,213 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import distage.{DIKey, Locator, SafeType, TagK}
-import izumi.distage.bootstrap.BootstrapLocator
-import izumi.distage.model.definition.DIResource.DIResourceBase
-import izumi.distage.model.definition.{DIResource, LocatorDef}
-import izumi.distage.model.effect.{DIApplicative, DIEffect, DIEffectAsync, DIEffectRunner}
-import izumi.distage.model.provisioning.PlanInterpreter.Finalizer
-import izumi.distage.model.references.IdentifiedRef
-import izumi.distage.testkit.services.scalatest.adapter.ExternalResourceProvider.{MemoizedInstance, PreparedShutdownRuntime}
-import izumi.fundamentals.platform.cache.SyncCache
-import izumi.fundamentals.platform.console.TrivialLogger
-import izumi.fundamentals.platform.functional.Identity
-import izumi.fundamentals.platform.language.Quirks
-
-import scala.annotation.unchecked.uncheckedVariance
-
-@deprecated("Use dstest", "2019/Jul/18")
-trait ExternalResourceProvider {
-  def process(ctx: MemoizationContextId, ref: MemoizedInstance[Any]): Unit
-
-  def isMemoized(ctx: MemoizationContextId, key: DIKey): Boolean
-
-  def getMemoized(ctx: MemoizationContextId, key: DIKey): Option[Any]
-
-  def size(ctx: MemoizationContextId): Int
-
-  def size: Int
-
-  def registerShutdownRuntime[F[_]: TagK](rt: => PreparedShutdownRuntime[F]): Unit
-}
-
-object ExternalResourceProvider {
-
-  case class OrderedFinalizer[+F[_]](finalizer: Finalizer[F@uncheckedVariance], order: Int)
-
-  case class MemoizedInstance[+F[_]](ref: IdentifiedRef, finalizer: Option[OrderedFinalizer[F@uncheckedVariance]])
-
-  case class PreparedShutdownRuntime[+F[_]](runner: DIResourceBase[Identity, Locator], fType: SafeType, fTag: TagK[F @uncheckedVariance])
-
-  object PreparedShutdownRuntime {
-    def apply[F[_]: TagK](runner: DIResourceBase[Identity, Locator]) = new PreparedShutdownRuntime[F](runner, SafeType.getK[F], TagK[F])
-  }
-
-  object Null extends ExternalResourceProvider {
-
-    override def process(memoizationContextId: MemoizationContextId, ref: MemoizedInstance[Any]): Unit = {
-      Quirks.discard(memoizationContextId, ref)
-    }
-
-    override def isMemoized(ctx: MemoizationContextId, key: DIKey): Boolean = false
-
-    override def getMemoized(ctx: MemoizationContextId, key: DIKey): Option[Any] = None
-
-    override def size(ctx: MemoizationContextId): Int = {
-      Quirks.discard(ctx)
-      0
-    }
-
-    override def size: Int = 0
-
-    override def registerShutdownRuntime[F[_]: TagK](rt: => PreparedShutdownRuntime[F]): Unit = {
-      Quirks.forget(rt)
-    }
-  }
-
-  def singleton[F[_]: TagK](memoize: IdentifiedRef => Boolean): Singleton[F] = new Singleton[F](memoize)
-
-  class Singleton[F[_]: TagK](
-                               memoize: IdentifiedRef => Boolean
-                             ) extends ExternalResourceProvider {
-
-    import Singleton.{MemoizationKey, cache, registerRT}
-
-    private[this] final val keyF = SafeType.getK[F]
-
-    override def process(ctx: MemoizationContextId, ref: MemoizedInstance[Any]): Unit = {
-      if (memoize(ref.ref)) {
-        cache.putIfNotExist(MemoizationKey(ctx, ref.ref.key, keyF), ref)
-      }
-    }
-
-    override def isMemoized(ctx: MemoizationContextId, key: DIKey): Boolean = {
-      cache.hasKey(MemoizationKey(ctx, key, keyF))
-    }
-
-    override def getMemoized(ctx: MemoizationContextId, key: DIKey): Option[Any] = {
-      cache.get(MemoizationKey(ctx, key, keyF)).map(_.ref.value)
-    }
-
-    override def size(ctx: MemoizationContextId): Int = {
-      cache.enumerate().count(_._1.ctx == ctx)
-    }
-
-    override def size: Int = {
-      cache.size
-    }
-
-    override def registerShutdownRuntime[F1[_]: TagK](rt: => PreparedShutdownRuntime[F1]): Unit = {
-      registerRT[F1](rt)
-    }
-  }
-
-  object Singleton {
-
-    case class MemoizationKey(ctx: MemoizationContextId, key: DIKey, fType: SafeType)
-
-    private val runtimes = new SyncCache[SafeType, PreparedShutdownRuntime[Any]]()
-
-    private val cache = new SyncCache[MemoizationKey, MemoizedInstance[Any]]()
-
-    private val shutdownHook = new Thread(() => stop(), "termination-hook-memoizer")
-
-    private val logger = TrivialLogger.make[BootstrapLocator]("izumi.distage.debug.memoizer")
-
-    Runtime.getRuntime.addShutdownHook(shutdownHook)
-
-    registerRT[Identity](
-      PreparedShutdownRuntime[Identity](
-        DIResource.liftF[Identity, Locator] {
-          new LocatorDef {
-            addImplicit[DIEffectRunner[Identity]]
-            addImplicit[DIApplicative[Identity]]
-            addImplicit[DIEffect[Identity]]
-            addImplicit[DIEffectAsync[Identity]]
-          }
-        }
-      )
-    )
-
-    private def registerRT[F[_]: TagK](rt: => PreparedShutdownRuntime[F]): Unit = {
-      runtimes.putIfNotExist(SafeType.getK[F], rt)
-    }
-
-    /**
-     * Fake HKT to use in-place of (unknown at compile-time) user effect type
-     *
-     * NOTE: DO NOT move this into an `object` or inside `stop()`, since then
-     * scala-reflect will start generating TypeTags for it and break it. Whether or not
-     * scala-reflect generates a TypeTag for an abstract member type is inconsistent
-     * and depends on the type's placement
-     * @see TagTest "Handle abstract types instead of parameters"
-     * */
-    private[Singleton] type FakeF[T]
-
-    private def stop(): Unit = {
-
-      runtimes.enumerate().foreach {
-        case (rtType, rt) =>
-
-          val effects = cache.enumerate()
-            .filter {
-              case (k, _) =>
-                rtType == k.fType
-            }
-            .flatMap(_._2.finalizer.toSeq)
-            .sortBy(_.order)
-            .map(_.finalizer)
-            .map {
-              fin =>
-                fin.asInstanceOf[Finalizer[FakeF]]
-            }
-          import DIEffect.syntax._
-
-          implicit val effectTagK: TagK[FakeF] = rt.fTag.asInstanceOf[TagK[FakeF]]
-          Quirks.discard(effectTagK)
-          assert(!effectTagK.toString.contains("FakeF"))
-
-          val effectTag = SafeType.get[DIEffect[FakeF]]
-          val runnerTag = SafeType.get[DIEffectRunner[FakeF]]
-
-          if (effects.nonEmpty) {
-            rt.runner.use {
-              locator =>
-
-                val shutdown = for {
-                  eff <- locator.instances.find(_.key.tpe == effectTag).map(_.value.asInstanceOf[DIEffect[FakeF]])
-                  ru <- locator.instances.find(_.key.tpe == runnerTag).map(_.value.asInstanceOf[DIEffectRunner[FakeF]])
-                } yield {
-                  implicit val F: DIEffect[FakeF] = eff
-                  implicit val runner: DIEffectRunner[FakeF] = ru
-                  runner.run {
-                    for {
-                      _ <- effects.foldLeft(F.maybeSuspend(logger.log(s"Running finalizers in effect type ${rt.fType}..."))) {
-                        case (acc, f) =>
-                          acc.guarantee {
-                            for {
-                              _ <- F.maybeSuspend(logger.log(s"Closing ${f.key}..."))
-                              _ <- F.suspendF(f.effect())
-                            } yield ()
-                          }
-                      }
-                      _ <- F.maybeSuspend(logger.log(s"Finished finalizers in effect type ${rt.fType}!"))
-                    } yield ()
-                  }
-                }
-
-                shutdown match {
-                  case Some(_) =>
-                  case None =>
-                    logger.log(s"Failed to build shutdown context. Required keys: $effectTag, $runnerTag, Locator content: ${locator.index.keySet}")
-                }
-
-            }
-          }
-      }
-
-    }
-
-
-  }
-
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/IgnoreSupport.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/IgnoreSupport.scala
deleted file mode 100644
index 7f4eadfc7..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/IgnoreSupport.scala
+++ /dev/null
@@ -1,23 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import org.scalatest.TestCancellationLegacy
-
-@deprecated("Use dstest", "2019/Jul/18")
-private[testkit] trait IgnoreSupport {
-  protected final def ignoreThisTest(cause: Throwable): Nothing = {
-    ignoreThisTest(None, Some(cause))
-  }
-
-  protected final def ignoreThisTest(message: String): Nothing = {
-    ignoreThisTest(Some(message), None)
-  }
-
-  protected final def ignoreThisTest(message: String, cause: Throwable): Nothing = {
-    ignoreThisTest(Some(message), Some(cause))
-  }
-
-  protected final def ignoreThisTest(message: Option[String] = None, cause: Option[Throwable] = None): Nothing = {
-    TestCancellationLegacy.cancel(message, cause)
-  }
-
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/MemoizationContextId.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/MemoizationContextId.scala
deleted file mode 100644
index 84a27f4cc..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/MemoizationContextId.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import distage.{Activation, SafeType}
-
-@deprecated("Use dstest", "2019/Jul/18")
-sealed trait MemoizationContextId
-
-object MemoizationContextId {
-
-  case object Shared extends MemoizationContextId
-
-  case class PerRuntimeAndActivationAndBsconfig[F[_]](bootstrapConfig: BootstrapConfig, activation: Activation, fType: SafeType) extends MemoizationContextId
-
-  case class Custom(id: String) extends MemoizationContextId
-
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/SuppressionSupport.scala b/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/SuppressionSupport.scala
deleted file mode 100644
index 0a1635c03..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/izumi/distage/testkit/services/scalatest/adapter/SuppressionSupport.scala
+++ /dev/null
@@ -1,21 +0,0 @@
-package izumi.distage.testkit.services.scalatest.adapter
-
-import java.util.concurrent.atomic.AtomicBoolean
-
-@deprecated("Use dstest", "2019/Jul/18")
-private[testkit] trait SuppressionSupport {
-  this: IgnoreSupport =>
-
-  private val suppressAll = new AtomicBoolean(false)
-
-  protected final def suppressTheRestOfTestSuite(): Unit = {
-    suppressAll.set(true)
-  }
-
-  protected[this] final def verifyTotalSuppression(): Unit = {
-    if (suppressAll.get()) {
-      ignoreThisTest("The rest of this test suite has been suppressed")
-    }
-  }
-
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/org/scalatest/ScalatestSuite.scala b/distage/distage-testkit-legacy/src/main/scala/org/scalatest/ScalatestSuite.scala
deleted file mode 100644
index b88994b2a..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/org/scalatest/ScalatestSuite.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.scalatest
-
-object ScalatestSuite {
-  def suiteToString(substitution: Option[(String, String)], theSuite: Suite): String = Suite.suiteToString(substitution, theSuite)
-}
-
diff --git a/distage/distage-testkit-legacy/src/main/scala/org/scalatest/TestCancellationLegacy.scala b/distage/distage-testkit-legacy/src/main/scala/org/scalatest/TestCancellationLegacy.scala
deleted file mode 100644
index b01b64c36..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/org/scalatest/TestCancellationLegacy.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.scalatest
-
-import org.scalatest.exceptions.TestCanceledException
-
-object TestCancellationLegacy {
-  def cancel(message: Option[String], cause: Option[Throwable], delta: Int = 0): Nothing = {
-    val exception = new TestCanceledException(message, cause, failedCodeStackDepth = 1 + delta)
-    val trace = exception.getStackTrace.filterNot(c => c.getClassName.startsWith("org.scalatest.") || c.getClassName.startsWith("sbt."))
-    exception.setStackTrace(trace)
-    throw exception
-  }
-}
diff --git a/distage/distage-testkit-legacy/src/main/scala/scalatest/adapter/specs/DistagePluginBioSpec.scala b/distage/distage-testkit-legacy/src/main/scala/scalatest/adapter/specs/DistagePluginBioSpec.scala
deleted file mode 100644
index e25d0aa70..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/scalatest/adapter/specs/DistagePluginBioSpec.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-package scalatest.adapter.specs
-
-import distage.TagKK
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class DistagePluginBioSpec[F[_, _]](implicit val tagBIO: TagKK[F]) extends DistagePluginSpec[F[Throwable, ?]]()
diff --git a/distage/distage-testkit-legacy/src/main/scala/scalatest/adapter/specs/DistagePluginSpec.scala b/distage/distage-testkit-legacy/src/main/scala/scalatest/adapter/specs/DistagePluginSpec.scala
deleted file mode 100644
index ccab51b6b..000000000
--- a/distage/distage-testkit-legacy/src/main/scala/scalatest/adapter/specs/DistagePluginSpec.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-package scalatest.adapter.specs
-
-import izumi.distage.testkit.services.scalatest.adapter.DistagePluginTestSupport
-import izumi.fundamentals.reflection.Tags.TagK
-import org.scalatest.ScalatestSuite
-import org.scalatest.wordspec.AnyWordSpecLike
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class DistagePluginSpec[F[_]](implicit val tagMonoIO: TagK[F]) extends DistagePluginTestSupport[F] with AnyWordSpecLike {
-
-  override def toString: String = ScalatestSuite.suiteToString(None, this)
-}
-
-
diff --git a/distage/distage-testkit-legacy/src/test/resources/scalatest-test-reference.conf b/distage/distage-testkit-legacy/src/test/resources/scalatest-test-reference.conf
deleted file mode 100644
index 2f9d2a389..000000000
--- a/distage/distage-testkit-legacy/src/test/resources/scalatest-test-reference.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-test {
-  provided = 1
-  overriden = 2
-}
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitBIOTest.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitBIOTest.scala
deleted file mode 100644
index f072184f5..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitBIOTest.scala
+++ /dev/null
@@ -1,30 +0,0 @@
-package izumi.distage.testkit.scalatest
-
-import distage.{ModuleBase, TagKK}
-import izumi.distage.model.definition.ModuleDef
-import izumi.distage.testkit.services.scalatest.adapter.DISyntaxBIO
-import izumi.functional.bio.{BIO, BIOError, F}
-import scalatest.adapter.specs.DistagePluginBioSpec
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class TestkitBIOTest[F[+_, +_]: BIO: TagKK] extends DistagePluginBioSpec[F]
-  with DISyntaxBIO[F] {
-
-  override protected def pluginPackages: Seq[String] = thisPackage
-
-  override protected def appOverride: ModuleBase = super.appOverride ++ new ModuleDef {
-    addImplicit[BIOError[F]]
-    addImplicit[BIO[F]]
-  }
-
-  "bio test with `Any` error" in dio {
-    () =>
-      F.when(false) {
-        F.fail("string failure!")
-      } *> BIO(println("success!"))
-  }
-
-}
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitBIOTestZio extends TestkitBIOTest[zio.IO]
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitIgnoredTest.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitIgnoredTest.scala
deleted file mode 100644
index a937db1dd..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitIgnoredTest.scala
+++ /dev/null
@@ -1,40 +0,0 @@
-package izumi.distage.testkit.scalatest
-
-import cats.effect.IO
-import distage.{LocatorRef, TagK}
-import izumi.distage.model.Locator
-import izumi.distage.model.reflection.universe.RuntimeDIUniverse._
-import izumi.distage.testkit.scalatest.fixtures.{TestService1, TestkitSelftest}
-import izumi.fundamentals.platform.functional.Identity
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class TestkitIgnoredTest[F[_] : TagK] extends TestkitSelftest[F] {
-  override protected def pluginPackages: Seq[String] = thisPackage
-
-  "testkit" must {
-    "support test suppression" in dio {
-      _: LocatorRef =>
-        fail("This test must be ignored")
-    }
-  }
-
-  override protected def additionalRoots: Set[distage.DIKey] = {
-    // here we may define the roots we need for dependency checks
-    Set(DIKey.get[TestService1])
-  }
-
-  /** You can override this to e.g. skip test when certain external dependencies are not available **/
-  override protected def beforeRun(context: Locator): Unit = {
-    assert(context.find[TestService1].isDefined)
-    ignoreThisTest() // and here we may conditionally ignore the tests or even use
-  }
-}
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitIgnoredTestIO extends TestkitIgnoredTest[IO]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitIgnoredTestIdentity extends TestkitIgnoredTest[Identity]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitIgnoredTestZio extends TestkitIgnoredTest[zio.IO[Throwable, ?]]
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitIntegrationCheckTest.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitIntegrationCheckTest.scala
deleted file mode 100644
index a296e9f28..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitIntegrationCheckTest.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-package izumi.distage.testkit.scalatest
-
-import cats.effect.IO
-import izumi.distage.testkit.scalatest.fixtures.{TestFailingIntegrationResource, TestkitSelftest}
-import izumi.fundamentals.platform.functional.Identity
-import distage.TagK
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class TestkitIntegrationCheckTest[F[_] : TagK] extends TestkitSelftest[F] {
-  "testkit" must {
-    "skip test if external resource check failed" in dio {
-      _: TestFailingIntegrationResource =>
-        fail("This test must be ignored")
-    }
-  }
-}
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitIntegrationCheckTestIO extends TestkitIntegrationCheckTest[IO]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitIntegrationCheckTestIdentity extends TestkitIntegrationCheckTest[Identity]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitIntegrationCheckTestZio extends TestkitIntegrationCheckTest[zio.IO[Throwable, ?]]
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitMemoizationTest.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitMemoizationTest.scala
deleted file mode 100644
index 5efc1b0c9..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitMemoizationTest.scala
+++ /dev/null
@@ -1,63 +0,0 @@
-package izumi.distage.testkit.scalatest
-
-import java.util.concurrent.atomic.AtomicReference
-
-import cats.effect.IO
-import izumi.distage.model.effect.DIEffect
-import izumi.distage.model.references.IdentifiedRef
-import izumi.distage.testkit.services.scalatest.adapter.ExternalResourceProvider
-import izumi.distage.testkit.scalatest.fixtures._
-import izumi.fundamentals.platform.functional.Identity
-import distage.TagK
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class TestkitMemoizationTest[F[_] : TagK] extends TestkitSelftest[F] {
-  val ref = new AtomicReference[TestResource1]()
-
-  "testkit" must {
-    "support memoization (1/2)" in dio {
-      (res: TestResource1, eff: DIEffect[F]) =>
-        eff.maybeSuspend {
-          assert(ref.get() == null)
-          ref.set(res)
-        }
-    }
-
-    "support memoization (2/2)" in dio {
-      (res: TestResource1, eff: DIEffect[F]) =>
-        eff.maybeSuspend {
-          assert(ref.get() eq res)
-        }
-    }
-
-    "not finalize resources immediately (1/2)" in dio {
-      (_: TestResourceDI, eff: DIEffect[F]) =>
-        eff.maybeSuspend {
-          assert(TestResourceDI.closeCount.get() == 0)
-        }
-    }
-
-    "not finalize resources immediately (2/2)" in {
-      assert(TestResourceDI.closeCount.get() == 0)
-    }
-
-  }
-
-  override protected def externalResourceProvider: ExternalResourceProvider = ExternalResourceProvider.singleton[F] {
-    case IdentifiedRef(_, _: TestResource1) =>
-      true
-    case IdentifiedRef(_, _: TestResourceDI) =>
-      true
-    case _ =>
-      false
-  }
-}
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitMemoizationTestIO extends TestkitMemoizationTest[IO]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitMemoizationTestIdentity extends TestkitMemoizationTest[Identity]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitMemoizationTestZio extends TestkitMemoizationTest[zio.IO[Throwable, ?]]
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitSuppressionTest.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitSuppressionTest.scala
deleted file mode 100644
index c6a6f52c6..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitSuppressionTest.scala
+++ /dev/null
@@ -1,49 +0,0 @@
-package izumi.distage.testkit.scalatest
-
-import java.util.concurrent.atomic.AtomicInteger
-
-import cats.effect.IO
-import distage.{DIKey, LocatorRef, TagK}
-import izumi.distage.model.Locator
-import izumi.distage.testkit.scalatest.fixtures.{TestService1, TestkitSelftest}
-import izumi.fundamentals.platform.functional.Identity
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class TestkitSuppressionTest[F[_] : TagK] extends TestkitSelftest[F] {
-  override protected def pluginPackages: Seq[String] = thisPackage
-  private val cc = new AtomicInteger(0)
-
-  "testkit" must {
-    "support suite-level suppression" in dio {
-      _: LocatorRef =>
-        fail("This test must be ignored")
-    }
-
-    "support test suppression" in dio {
-      _: LocatorRef =>
-        fail("This test must be ignored as well")
-    }
-  }
-
-
-  override protected def additionalRoots: Set[distage.DIKey] = {
-    // here we may define the roots we need for dependency checks
-    Set(DIKey.get[TestService1])
-  }
-
-  /** You can override this to e.g. skip test when certain external dependencies are not available **/
-  override protected def beforeRun(context: Locator): Unit = {
-    assert(context.find[TestService1].isDefined)
-    assert(cc.incrementAndGet() == 1)
-    suppressTheRestOfTestSuite()
-  }
-}
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitSuppressionTestIO extends TestkitSuppressionTest[IO]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitSuppressionTestIdentity extends TestkitSuppressionTest[Identity]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitSuppressionTestZio extends TestkitSuppressionTest[zio.IO[Throwable, ?]]
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitTest.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitTest.scala
deleted file mode 100644
index 1e9c344a1..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/TestkitTest.scala
+++ /dev/null
@@ -1,90 +0,0 @@
-package izumi.distage.testkit.scalatest
-
-import cats.effect.IO
-import distage.{DIKey, Id, LocatorRef, ModuleBase, TagK}
-import izumi.distage.config.ConfigModuleDef
-import izumi.distage.model.definition.ModuleDef
-import izumi.distage.model.effect.DIEffect
-import izumi.distage.testkit.scalatest.fixtures._
-import izumi.fundamentals.platform.functional.Identity
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class TestkitTest[F[_]: TagK] extends TestkitSelftest[F] {
-  "testkit" must {
-    "load plugins" in dio {
-      (service: TestService1, locatorRef: LocatorRef, eff: DIEffect[F]) =>
-        eff.maybeSuspend {
-          assert(locatorRef.get.instances.exists(_.value == service))
-          assert(!locatorRef.get.instances.exists(_.value.isInstanceOf[TestService2]))
-        }
-    }
-
-    // can't do that now
-//    "create classes in `di` arguments even if they that aren't in makeBindings" in dio {
-//      (notAdded: NotAddedClass, eff: DIEffect[F]) =>
-//        eff.maybeSuspend {
-//          assert(notAdded == NotAddedClass())
-//        }
-//    }
-
-    "start and close resources and role components in correct order" in {
-      var ref: LocatorRef = null
-
-      dio {
-        (_: TestService1, locatorRef: LocatorRef, eff: DIEffect[F]) =>
-          eff.maybeSuspend {
-            ref = locatorRef
-          }
-      }
-
-      val ctx = ref.get
-      assert(ctx.get[SelftestCounters].closedCloseables == Seq(ctx.get[TestService1], ctx.get[TestResource2], ctx.get[TestResource1]))
-    }
-
-    "load config" in dio {
-      (service: TestService2, eff: DIEffect[F]) =>
-        eff.maybeSuspend {
-          assert(service.cfg1.provided == 111)
-          assert(service.cfg1.overriden == 222)
-
-          assert(service.cfg.provided == 1)
-          assert(service.cfg.overriden == 3)
-        }
-    }
-
-    "support non-io interface" in di {
-      service: TestService1 =>
-        assert(service != null)
-    }
-
-    "resolve conflicts" in di {
-      service: Conflict =>
-        assert(service.isInstanceOf[Conflict1])
-    }
-  }
-
-  override protected def appOverride: ModuleBase = super.appOverride overridenBy new ConfigModuleDef {
-    // FIXME: implement Provider mutators ???
-    makeConfig[TestConf]("test").aliased[TestConf]("test1")
-    make[TestConf].named("test").from((_: TestConf @Id("test1")).copy(overriden = 3))
-  }
-
-  override protected def refineBindings(roots: Set[DIKey], primaryModule: ModuleBase): ModuleBase = {
-    super.refineBindings(roots, primaryModule) overridenBy new ModuleDef {
-      make[TestConf].named("missing-test-section").from(TestConf(111, 222))
-    }
-  }
-}
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitTestIO extends TestkitTest[IO]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitTestIdentity extends TestkitTest[Identity]
-
-@deprecated("Use dstest", "2019/Jul/18")
-class TestkitTestZio extends TestkitTest[zio.IO[Throwable, ?]]
-
-object TestkitTest {
-  case class NotAddedClass()
-}
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/fixtures/Fixtures.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/fixtures/Fixtures.scala
deleted file mode 100644
index 1b1d031da..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/fixtures/Fixtures.scala
+++ /dev/null
@@ -1,112 +0,0 @@
-package izumi.distage.testkit.scalatest.fixtures
-
-
-import java.util.concurrent.atomic.AtomicInteger
-
-import distage.Id
-import distage.config.ConfigModuleDef
-import izumi.distage.model.definition.DIResource
-import izumi.distage.model.definition.StandardAxis._
-import izumi.distage.effect.modules.{CatsDIEffectModule, ZIODIEffectModule}
-import izumi.distage.framework.model.IntegrationCheck
-import izumi.distage.plugins.PluginDef
-import izumi.fundamentals.platform.integration.ResourceCheck
-import izumi.fundamentals.platform.language.Quirks
-import izumi.logstage.api.IzLogger
-
-import scala.collection.mutable
-
-class SelftestCounters {
-  val closedCloseables: mutable.ArrayBuffer[AutoCloseable] = mutable.ArrayBuffer()
-}
-
-class TestResourceDI() extends AutoCloseable {
-  override def close(): Unit = {
-    Quirks.discard(TestResourceDI.closeCount.incrementAndGet())
-  }
-}
-
-object TestResourceDI {
-  final val closeCount = new AtomicInteger()
-}
-
-class TestResource1(counter: SelftestCounters, logger: IzLogger) extends AutoCloseable {
-  override def close(): Unit = counter.closedCloseables += {
-    logger.info(s"[test] Closing $this")
-    this
-  }
-}
-
-class TestResource2(val testResource1: TestResource1, counter: SelftestCounters, logger: IzLogger) extends AutoCloseable {
-  override def close(): Unit = {
-    logger.info(s"[test] Closing $this")
-    counter.closedCloseables += this
-  }
-}
-
-class TestService1(val testResource2: TestResource2, val testComponent3: TestComponent3, counter: SelftestCounters, logger: IzLogger) extends AutoCloseable {
-  override def close(): Unit = {
-    logger.info(s"[test] Closing $this")
-    counter.closedCloseables += this
-  }
-}
-
-case class TestComponent1(counter: SelftestCounters, logger: IzLogger)
-
-case class TestComponent2(testComponent1: TestComponent1, counter: SelftestCounters, logger: IzLogger)
-
-case class TestComponent3(testComponent2: TestComponent2, counter: SelftestCounters, logger: IzLogger)
-
-class TestFailingIntegrationResource extends IntegrationCheck {
-  override def resourcesAvailable(): ResourceCheck =
-    ResourceCheck.ResourceUnavailable("Resource check test", None)
-}
-
-case class TestConf(provided: Int, overriden: Int)
-
-case class TestConf1(x: Int, y: Int)
-
-class TestService2(
-                    @Id("test") val cfg: TestConf,
-                    @Id("missing-test-section") val cfg1: TestConf,
-                  )
-
-trait Conflict
-case class Conflict1() extends Conflict
-case class Conflict2(u: UnsolvableConflict) extends Conflict
-
-trait UnsolvableConflict
-class UnsolvableConflict1 extends UnsolvableConflict
-class UnsolvableConflict2 extends UnsolvableConflict
-
-class TestPlugin01 extends PluginDef {
-  make[Conflict].tagged(Env.Test).from[Conflict1]
-  make[Conflict].tagged(Env.Prod).from[Conflict2]
-  make[UnsolvableConflict].from[UnsolvableConflict1]
-  make[UnsolvableConflict].from[UnsolvableConflict2]
-}
-
-object MonadPlugin extends PluginDef
-  with CatsDIEffectModule
-  with ZIODIEffectModule
-
-object TestPlugin00
-  extends PluginDef {
-  make[TestService1]
-  make[TestService2]
-  make[TestResource1]
-  make[TestResource2]
-  make[SelftestCounters]
-  make[TestComponent3]
-  make[TestComponent2]
-  make[TestComponent1]
-  make[TestFailingIntegrationResource]
-  make[TestResourceDI].fromResource(DIResource.fromAutoCloseable(new TestResourceDI()))
-
-  include(new ConfigModuleDef {
-    makeConfigNamed[TestConf]("test")
-    makeConfigNamed[TestConf]("missing-test-section")
-  })
-}
-
-
diff --git a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/fixtures/TestkitSelftest.scala b/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/fixtures/TestkitSelftest.scala
deleted file mode 100644
index 17319fb48..000000000
--- a/distage/distage-testkit-legacy/src/test/scala/izumi/distage/testkit/scalatest/fixtures/TestkitSelftest.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-package izumi.distage.testkit.scalatest.fixtures
-
-import distage.TagK
-import scalatest.adapter.specs.DistagePluginSpec
-
-@deprecated("Use dstest", "2019/Jul/18")
-abstract class TestkitSelftest[F[_]: TagK] extends DistagePluginSpec[F]{
-  override protected def pluginPackages: Seq[String] = thisPackage
-}