Skip to content

Commit 6998424

Browse files
authored
enable more sbt 2 tests (sbt#200)
1 parent d9b1e02 commit 6998424

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

build.sbt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ lazy val plugin = (project in file("src/plugin"))
8181
"basic" -> "dispatcher",
8282
"basic" -> "finds-test-from-extended-config",
8383
"basic" -> "finds-test-from-it-config",
84-
"basic" -> "run-listener",
8584
"basic" -> "tags",
86-
"interop" -> "reports-missing-runtime"
8785
)
8886
val args = values.filterNot(exclude).map { case (x1, x2) => s"${x1}/${x2}" }
8987
val arg = args.mkString(" ", " ", "")

src/plugin/src/sbt-test/basic/run-listener/build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ libraryDependencies ++= Seq(
55

66
InputKey[Unit]("tests-executed") := {
77
val expected = Def.spaceDelimited("<test-classes>").parsed
8-
val testsrun = IO.readLines(target.value / "testsrun").toSet
8+
val testsrun = IO.readLines(file("target/testsrun")).toSet
99
expected.foreach { test =>
1010
if (!testsrun(test)) {
1111
throw new RuntimeException("Expected test " + test + " to be run, but it wasn't. Tests that were run:\n" + testsrun.mkString("\n"))
@@ -15,7 +15,7 @@ InputKey[Unit]("tests-executed") := {
1515

1616
InputKey[Unit]("tests-not-executed") := {
1717
val notExpected = Def.spaceDelimited("<test-classes>").parsed
18-
val testsrun = IO.readLines(target.value / "testsrun").toSet
18+
val testsrun = IO.readLines(file("target/testsrun")).toSet
1919
notExpected.foreach { test =>
2020
if (testsrun(test)) {
2121
throw new RuntimeException("Expected test " + test + " not to be run, but it was. Tests that were run:\n" + testsrun.mkString("\n"))
@@ -24,5 +24,5 @@ InputKey[Unit]("tests-not-executed") := {
2424
}
2525

2626
TaskKey[Unit]("reset-tests") := {
27-
(target.value / "testsrun").delete()
28-
}
27+
file("target/testsrun").delete()
28+
}

src/plugin/src/sbt-test/interop/reports-missing-runtime/build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ libraryDependencies ++= Seq(
2727
* library is missing.
2828
*/
2929
TaskKey[Unit]("checkDefinedTestsThrowsException") := {
30-
(Test / definedTests).result.value match {
31-
case Inc(cause:Incomplete) =>
30+
(Test / definedTests).result.value.toEither match {
31+
case Left(cause:Incomplete) =>
3232
val actualMessage = cause.causes.flatMap(_.causes).headOption.flatMap(_.directCause).map(_.getMessage).getOrElse("")
3333
val expectedMessage = "Found at least one JUnit 5 test"
3434
assert(actualMessage.startsWith(expectedMessage),
3535
s"Expected an exception containing a message starting with `$expectedMessage` (actual: `$actualMessage`)")
3636
Seq.empty
37-
case Value(_:Seq[TestDefinition]) =>
37+
case Right(_:Seq[TestDefinition]) =>
3838
sys.error(s"Expected task `definedTests` to throw an exception due to " +
3939
"`jupiter-interface` not being on the test-classpath.")
4040
}

0 commit comments

Comments
 (0)