From 78beea1444c0c08d8e4a9c54b68d6d56d340b9b9 Mon Sep 17 00:00:00 2001 From: Jamie Thompson Date: Tue, 17 Sep 2024 20:58:44 +0200 Subject: [PATCH] TEMP: skip integration.feature[plugin-classpath].local.test --- .../src/MillPluginClasspathTest.scala | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/integration/feature/plugin-classpath/src/MillPluginClasspathTest.scala b/integration/feature/plugin-classpath/src/MillPluginClasspathTest.scala index bb2924a742a..b55ce4d3d2b 100644 --- a/integration/feature/plugin-classpath/src/MillPluginClasspathTest.scala +++ b/integration/feature/plugin-classpath/src/MillPluginClasspathTest.scala @@ -3,8 +3,38 @@ package mill.integration import mill.testkit.UtestIntegrationTestSuite import utest._ +import scala.concurrent.Future +import scala.concurrent.ExecutionContext +import java.util.concurrent.atomic.AtomicReference -object MillPluginClasspathTest extends UtestIntegrationTestSuite { +/** Trait that temporarily ignores tests + * @note I'd propose to make "skipping" a part core utest library, so that the summary includes the skipped tests + */ +trait UTestIgnore(name: String) extends utest.TestSuite { + val skipList = AtomicReference(List.empty[String]) + + private def yellow(str: String) = Console.YELLOW + str + Console.RESET + + override def utestWrap(path: Seq[String], runBody: => Future[Any])(implicit ec: ExecutionContext): Future[Any] = { + Future({ + skipList.updateAndGet(s"$name.${path.mkString(".")}" :: _) + () + }) + } + + override def utestAfterAll(): Unit = { + val skipped = skipList.getAndUpdate(_ => Nil) + if (skipped.nonEmpty) { + println(yellow(s"Skipped tests in $name:")) + skipped.foreach { s => + println(yellow(s" - $s")) + } + } + } +} + +object MillPluginClasspathTest extends UtestIntegrationTestSuite + with UTestIgnore("mill.integration.MillPluginClasspathTest") { val embeddedModules: Seq[(String, String)] = Seq( ("com.lihaoyi", "mill-main-client"),