mirror of https://github.com/sbt/sbt.git
Remove IntegrationTest
This commit is contained in:
parent
c8fa434eb3
commit
ac57fb083e
|
|
@ -17,7 +17,7 @@ object DependencyTreePlugin extends AutoPlugin {
|
|||
override def requires = MiniDependencyTreePlugin
|
||||
|
||||
@nowarn
|
||||
val configurations = Vector(Compile, Test, IntegrationTest, Runtime, Provided, Optional)
|
||||
val configurations = Vector(Compile, Test, Runtime, Provided, Optional)
|
||||
|
||||
// MiniDependencyTreePlugin provides baseBasicReportingSettings for Compile and Test
|
||||
override lazy val projectSettings: Seq[Def.Setting[?]] =
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ object ConfigRef extends sbt.librarymanagement.ConfigRefFunctions {
|
|||
private val cache = new TrieMap[String, ConfigRef]
|
||||
private lazy val Default = new ConfigRef("default")
|
||||
private lazy val Compile = new ConfigRef("compile")
|
||||
private lazy val IntegrationTest = new ConfigRef("it")
|
||||
private lazy val Provided = new ConfigRef("provided")
|
||||
private lazy val Runtime = new ConfigRef("runtime")
|
||||
private lazy val Test = new ConfigRef("test")
|
||||
|
|
@ -49,13 +48,11 @@ object ConfigRef extends sbt.librarymanagement.ConfigRefFunctions {
|
|||
private lazy val Component = new ConfigRef("component")
|
||||
private lazy val RuntimeInternal = new ConfigRef("runtime-internal")
|
||||
private lazy val TestInternal = new ConfigRef("test-internal")
|
||||
private lazy val IntegrationTestInternal = new ConfigRef("it-internal")
|
||||
private lazy val CompileInternal = new ConfigRef("compile-internal")
|
||||
|
||||
def apply(name: String): ConfigRef = name match {
|
||||
case "default" => Default
|
||||
case "compile" => Compile
|
||||
case "it" => IntegrationTest
|
||||
case "provided" => Provided
|
||||
case "runtime" => Runtime
|
||||
case "test" => Test
|
||||
|
|
@ -68,7 +65,6 @@ object ConfigRef extends sbt.librarymanagement.ConfigRefFunctions {
|
|||
case "component" => Component
|
||||
case "runtime-internal" => RuntimeInternal
|
||||
case "test-internal" => TestInternal
|
||||
case "it-internal" => IntegrationTestInternal
|
||||
case "compile-internal" => CompileInternal
|
||||
case _ => cache.getOrElseUpdate(name, new ConfigRef(name))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,17 +21,14 @@ object Configurations {
|
|||
|
||||
lazy val RuntimeInternal = optionalInternal(Runtime)
|
||||
lazy val TestInternal = fullInternal(Test)
|
||||
@nowarn
|
||||
lazy val IntegrationTestInternal = fullInternal(IntegrationTest)
|
||||
lazy val CompileInternal = fullInternal(Compile)
|
||||
|
||||
@nowarn
|
||||
def internalMap(c: Configuration) = c match {
|
||||
case Compile => CompileInternal
|
||||
case Test => TestInternal
|
||||
case Runtime => RuntimeInternal
|
||||
case IntegrationTest => IntegrationTestInternal
|
||||
case _ => c
|
||||
case Compile => CompileInternal
|
||||
case Test => TestInternal
|
||||
case Runtime => RuntimeInternal
|
||||
case _ => c
|
||||
}
|
||||
|
||||
private[sbt] def internal(base: Configuration, ext: Configuration*) =
|
||||
|
|
@ -43,8 +40,6 @@ object Configurations {
|
|||
|
||||
lazy val Default = Configuration.of("Default", "default")
|
||||
lazy val Compile = Configuration.of("Compile", "compile")
|
||||
@deprecated("Create a separate subproject for testing instead", "1.9.0")
|
||||
lazy val IntegrationTest = Configuration.of("IntegrationTest", "it").extend(Runtime)
|
||||
lazy val Provided = Configuration.of("Provided", "provided")
|
||||
lazy val Runtime = Configuration.of("Runtime", "runtime").extend(Compile)
|
||||
lazy val Test = Configuration.of("Test", "test").extend(Runtime)
|
||||
|
|
@ -70,11 +65,11 @@ object Configurations {
|
|||
@nowarn
|
||||
private[sbt] def underScalaVersion(c: Configuration): Boolean =
|
||||
c match {
|
||||
case Default | Compile | IntegrationTest | Provided | Runtime | Test | Optional |
|
||||
CompilerPlugin | CompileInternal | RuntimeInternal | TestInternal =>
|
||||
case Default | Compile | Provided | Runtime | Test | Optional | CompilerPlugin |
|
||||
CompileInternal | RuntimeInternal | TestInternal =>
|
||||
true
|
||||
case config =>
|
||||
config.extendsConfigs exists underScalaVersion
|
||||
config.extendsConfigs.exists(underScalaVersion)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ trait LibraryManagementSyntax
|
|||
final val Compile = C.Compile
|
||||
final val Test = C.Test
|
||||
final val Runtime = C.Runtime
|
||||
@deprecated("Create a separate subproject for testing instead", "1.9.0")
|
||||
final val IntegrationTest = C.IntegrationTest
|
||||
final val Default = C.Default
|
||||
final val Provided = C.Provided
|
||||
// java.lang.System is more important, so don't alias this one
|
||||
|
|
|
|||
|
|
@ -169,7 +169,6 @@ object Scope:
|
|||
|
||||
private[sbt] val configIdents: Map[String, String] =
|
||||
Map(
|
||||
"it" -> "IntegrationTest",
|
||||
"scala-tool" -> "ScalaTool",
|
||||
"plugin" -> "CompilerPlugin"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ object BuildSettingsInstances:
|
|||
2 -> Gen.constant[ConfigKey](Compile),
|
||||
2 -> Gen.constant[ConfigKey](Test),
|
||||
1 -> Gen.constant[ConfigKey](Runtime),
|
||||
1 -> Gen.constant[ConfigKey](IntegrationTest),
|
||||
1 -> Gen.constant[ConfigKey](Provided),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -58,14 +58,7 @@ import sbt.io.Path.*
|
|||
import sbt.io.*
|
||||
import sbt.io.syntax.*
|
||||
import sbt.librarymanagement.Artifact.{ DocClassifier, SourceClassifier }
|
||||
import sbt.librarymanagement.Configurations.{
|
||||
Compile,
|
||||
CompilerPlugin,
|
||||
IntegrationTest,
|
||||
Provided,
|
||||
Runtime,
|
||||
Test
|
||||
}
|
||||
import sbt.librarymanagement.Configurations.{ Compile, CompilerPlugin, Provided, Runtime, Test }
|
||||
import sbt.librarymanagement.CrossVersion.{ binarySbtVersion, binaryScalaVersion, partialVersion }
|
||||
import sbt.librarymanagement.*
|
||||
import sbt.librarymanagement.ivy.*
|
||||
|
|
@ -2485,12 +2478,6 @@ object Defaults extends BuildCommon {
|
|||
|
||||
lazy val testSettings: Seq[Setting[?]] = configSettings ++ testTasks
|
||||
|
||||
@nowarn
|
||||
@deprecated(
|
||||
"Create a separate subproject instead of using IntegrationTest and in addition avoid using itSettings",
|
||||
"1.9.0"
|
||||
)
|
||||
lazy val itSettings: Seq[Setting[?]] = inConfig(IntegrationTest)(testSettings)
|
||||
lazy val defaultConfigs: Seq[Setting[?]] = inConfig(Compile)(compileSettings) ++
|
||||
inConfig(Test)(testSettings) ++
|
||||
inConfig(Runtime)(Classpaths.configSettings)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ private[sbt] object ClassLoaders {
|
|||
}
|
||||
private val interfaceLoader = classOf[sbt.testing.Framework].getClassLoader
|
||||
/*
|
||||
* Get the class loader for a test task. The configuration could be IntegrationTest or Test.
|
||||
* Get the class loader for a test task. The configuration could be Test.
|
||||
*/
|
||||
private[sbt] def testTask: Def.Initialize[Task[ClassLoader]] = Def.task {
|
||||
val si = scalaInstance.value
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ object BuildServerProtocol {
|
|||
bspScalaMainClasses / aggregate := false,
|
||||
)
|
||||
|
||||
// This will be scoped to Compile, Test, IntegrationTest etc
|
||||
// This will be scoped to Compile, Test, etc
|
||||
lazy val configSettings: Seq[Def.Setting[?]] = Seq(
|
||||
bspTargetIdentifier := {
|
||||
val ref = thisProjectRef.value
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import KeyRanks.*
|
|||
import sbt.ProjectExtra.inConfig
|
||||
import sbt.internal.*
|
||||
import sbt.io.syntax.*
|
||||
import sbt.librarymanagement.Configurations.{ IntegrationTest, Test }
|
||||
import sbt.librarymanagement.Configurations.Test
|
||||
import scala.annotation.nowarn
|
||||
|
||||
/**
|
||||
|
|
@ -56,6 +56,5 @@ object JUnitXmlReportPlugin extends AutoPlugin {
|
|||
|
||||
@nowarn
|
||||
override lazy val projectSettings: Seq[Setting[?]] =
|
||||
inConfig(Test)(testReportSettings) ++
|
||||
inConfig(IntegrationTest)(testReportSettings)
|
||||
inConfig(Test)(testReportSettings)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,13 +13,11 @@ object BuildTargetTag {
|
|||
val test: String = "test"
|
||||
val application: String = "application"
|
||||
val library: String = "library"
|
||||
val integrationTest: String = "integration-test"
|
||||
val benchmark: String = "benchmark"
|
||||
val noIDE: String = "no-ide"
|
||||
|
||||
def fromConfig(config: String): Vector[String] = config match {
|
||||
case "test" => Vector(test)
|
||||
case "it" => Vector(integrationTest)
|
||||
case "compile" => Vector(library)
|
||||
case _ => Vector.empty
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,5 +69,4 @@ lazy val d = project.settings(
|
|||
// these shouldn't get picked up
|
||||
Compile / compile / taskX := Set(32366),
|
||||
compile / taskX := Set(548686),
|
||||
Configurations.IntegrationTest / taskX := Set(11111),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
ThisBuild / scalaVersion := "2.12.20"
|
||||
|
||||
val specs = "org.specs2" %% "specs2-core" % "4.3.4"
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.configs(IntegrationTest)
|
||||
.settings(
|
||||
Defaults.itSettings,
|
||||
libraryDependencies += specs % IntegrationTest
|
||||
)
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package org.example
|
||||
|
||||
// this tests that normal tests do not
|
||||
// interfere with integration tests (#539)
|
||||
|
||||
import org.specs2.mutable._
|
||||
|
||||
class B extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"not work" in { 1 must_== 2 }
|
||||
}
|
||||
}
|
||||
|
||||
object A extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"not work" in { 1 must_== 2 }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import org.specs2.mutable._
|
||||
|
||||
class B extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"not work" in { 1 must_== 2 }
|
||||
}
|
||||
}
|
||||
|
||||
object A extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"not work" in { 1 must_== 2 }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import org.specs2.mutable._
|
||||
|
||||
class B extends Specification
|
||||
{
|
||||
"'hello world' has 11 characters" in {
|
||||
"hello world".length must be equalTo(122)
|
||||
}
|
||||
}
|
||||
|
||||
object A extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"work" in { 1 must_== 1 }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import org.specs2.mutable._
|
||||
|
||||
class B extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"work" in { 1 must_== 1 }
|
||||
}
|
||||
}
|
||||
|
||||
object A extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"not work" in { 1 must_== 2 }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import org.specs2.mutable._
|
||||
|
||||
class B extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"work" in { 1 must_== 1 }
|
||||
}
|
||||
}
|
||||
|
||||
object A extends Specification
|
||||
{
|
||||
"this" should {
|
||||
"work" in { 1 must_== 1 }
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
> clean
|
||||
$ delete src/
|
||||
$ copy-file changes/ClassFailModuleSuccess.scala src/it/scala/Test.scala
|
||||
-> IntegrationTest/test
|
||||
|
||||
> clean
|
||||
$ delete src/
|
||||
$ copy-file changes/ClassFailModuleFail.scala src/it/scala/Test.scala
|
||||
-> IntegrationTest/test
|
||||
|
||||
> clean
|
||||
$ delete src/
|
||||
$ copy-file changes/ClassSuccessModuleFail.scala src/it/scala/Test.scala
|
||||
-> IntegrationTest/test
|
||||
|
||||
|
||||
> clean
|
||||
$ delete src/
|
||||
$ copy-file changes/ClassSuccessModuleSuccess.scala src/it/scala/Test.scala
|
||||
> IntegrationTest/test
|
||||
|
||||
# verify that a failing normal test fails when run directly
|
||||
$ copy-file changes/AlwaysFail.scala src/test/scala/AlwaysFail.scala
|
||||
-> Test/test
|
||||
|
||||
# but that it does not affect the result of IntegrationTest/test (#539)
|
||||
> IntegrationTest/test
|
||||
Loading…
Reference in New Issue