From 24f4f88914cc5219969757e112d91ce1dccdf528 Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Tue, 13 Apr 2021 12:28:39 -0700 Subject: [PATCH 1/3] community build: add support for testOnlyDependencies This allows specifying dependencies that are needed only to build the test suite of a community build project. The evaluation of this list is delayed to permit what would otherwise be circular dependencies. The addition of this capability is motivated by recent versions of ScalaTest, which since version 3.2.4 has test-only dependencies on scalatestplus-junit and scalatestplus-testng, which in turn both depend on ScalaTest itself. --- community-build/src/scala/dotty/communitybuild/projects.scala | 3 +++ .../test/scala/dotty/communitybuild/CommunityBuildTest.scala | 1 + 2 files changed, 4 insertions(+) diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index cc792159b104..014bcbfc25fe 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -40,6 +40,7 @@ sealed trait CommunityProject: val publishCommand: String val docCommand: String val dependencies: List[CommunityProject] + val testOnlyDependencies: () => List[CommunityProject] val binaryName: String val runCommandsArgs: List[String] = Nil val requiresExperimental: Boolean @@ -87,6 +88,7 @@ final case class MillCommunityProject( project: String, baseCommand: String, dependencies: List[CommunityProject] = Nil, + testOnlyDependencies: () => List[CommunityProject] = () => Nil, ignoreDocs: Boolean = false, requiresExperimental: Boolean = false, ) extends CommunityProject: @@ -104,6 +106,7 @@ final case class SbtCommunityProject( sbtTestCommand: String, extraSbtArgs: List[String] = Nil, dependencies: List[CommunityProject] = Nil, + testOnlyDependencies: () => List[CommunityProject] = () => Nil, sbtPublishCommand: String = null, sbtDocCommand: String = null, scalacOptions: List[String] = SbtCommunityProject.scalacOptions, diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index eb16e2466bc8..95bb97382fc2 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -27,6 +27,7 @@ abstract class CommunityBuildTest: ) return self.dependencies.foreach(_.publish()) + self.testOnlyDependencies().foreach(_.publish()) suite.test(self) /** Build the given project with the published local compiler and sbt plugin. From 4a74d6ff33b0ce1b8a9ace2350c0d0828c7a7668 Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Tue, 13 Apr 2021 12:33:24 -0700 Subject: [PATCH 2/3] community build: add scalatestplus-testng It is a dependency of the ScalaTest test suite since ScalaTest 3.2.4 --- .gitmodules | 3 +++ community-build/community-projects/scalatestplus-testng | 1 + .../src/scala/dotty/communitybuild/projects.scala | 8 ++++++++ .../scala/dotty/communitybuild/CommunityBuildTest.scala | 1 + 4 files changed, 13 insertions(+) create mode 160000 community-build/community-projects/scalatestplus-testng diff --git a/.gitmodules b/.gitmodules index d922c875223a..b61a6eaf411f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -193,3 +193,6 @@ [submodule "community-build/community-projects/play-json"] path = community-build/community-projects/play-json url = https://github.com/dotty-staging/play-json.git +[submodule "community-build/community-projects/scalatestplus-testng"] + path = community-build/community-projects/scalatestplus-testng + url = https://github.com/dotty-staging/scalatestplus-testng.git diff --git a/community-build/community-projects/scalatestplus-testng b/community-build/community-projects/scalatestplus-testng new file mode 160000 index 000000000000..f7a439f1b207 --- /dev/null +++ b/community-build/community-projects/scalatestplus-testng @@ -0,0 +1 @@ +Subproject commit f7a439f1b2078b748bc904c5c774ad1205561e31 diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 014bcbfc25fe..72f644c04254 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -302,6 +302,13 @@ object projects: dependencies = List(scalatest) ) + lazy val scalatestplusTestNG = SbtCommunityProject( + project = "scalatestplus-testng", + sbtTestCommand = "test", + sbtPublishCommand = "publishLocal", + dependencies = List(scalatest) + ) + lazy val scalaXml = SbtCommunityProject( project = "scala-xml", sbtTestCommand = "xml/test", @@ -739,6 +746,7 @@ def allProjects = List( projects.protoquill, projects.onnxScala, projects.playJson, + projects.scalatestplusTestNG, ) lazy val projectMap = allProjects.groupBy(_.project) diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 95bb97382fc2..8290c904692e 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -97,6 +97,7 @@ class CommunityBuildTestA extends CommunityBuildTest: @Test def izumiReflect = projects.izumiReflect.run() @Test def scalaSTM = projects.scalaSTM.run() @Test def scalatest = projects.scalatest.run() + @Test def scalatestplusTestNG = projects.scalatestplusTestNG.run() // 'Sciss/Lucre' dependencies: // @Test def scissEqual = projects.scissEqual .run() // @Test def scissFingerTree = projects.scissFingerTree.run() From eaac97ac50deb5639099483265dc4dfdcf6b3ba4 Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Tue, 13 Apr 2021 12:37:33 -0700 Subject: [PATCH 3/3] community build: update scalatest and friends to upstream 3.2.7 ScalaTest 3.2.7 brings support for Scala.js with Scala 3. --- community-build/community-projects/scalatest | 2 +- .../community-projects/scalatestplus-junit | 2 +- .../community-projects/scalatestplus-scalacheck | 2 +- .../src/scala/dotty/communitybuild/projects.scala | 13 ++++++++----- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index d3b7db9af036..96650cfbf700 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit d3b7db9af036829e417e6a08940d9e4e406cfbf2 +Subproject commit 96650cfbf7003c198e2759bdca4a9a37dac03cad diff --git a/community-build/community-projects/scalatestplus-junit b/community-build/community-projects/scalatestplus-junit index 3857010185d9..dd047825a880 160000 --- a/community-build/community-projects/scalatestplus-junit +++ b/community-build/community-projects/scalatestplus-junit @@ -1 +1 @@ -Subproject commit 3857010185d95c3b5fece4800759436ceebdc0e7 +Subproject commit dd047825a880bb467d69833dca198a27c8e30f87 diff --git a/community-build/community-projects/scalatestplus-scalacheck b/community-build/community-projects/scalatestplus-scalacheck index 010387f5854e..c9d4faeb8e1c 160000 --- a/community-build/community-projects/scalatestplus-scalacheck +++ b/community-build/community-projects/scalatestplus-scalacheck @@ -1 +1 @@ -Subproject commit 010387f5854eb473ddc71ecd2d6a0183dfebfbcb +Subproject commit c9d4faeb8e1c815bd932fd67a5d2fe138a2bbda8 diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 72f644c04254..106952d1cb2a 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -276,15 +276,17 @@ object projects: sbtDocCommand = forceDoc("jvm") ) - lazy val scalatest = SbtCommunityProject( + lazy val scalatest: SbtCommunityProject = SbtCommunityProject( project = "scalatest", - sbtTestCommand = "scalacticDotty/clean;scalacticTestDotty/test; scalatestTestDotty/test", - sbtPublishCommand = "scalacticDotty/publishLocal; scalatestDotty/publishLocal", - sbtDocCommand = ";scalacticDotty/doc" // fails with missing type ;scalatestDotty/doc" + sbtTestCommand = "scalacticDotty/clean; scalacticDottyJS/clean; scalacticTestDotty/test; scalatestTestDotty/test; scalacticDottyJS/compile; scalatestDottyJS/compile", + sbtPublishCommand = "scalacticDotty/publishLocal; scalatestDotty/publishLocal; scalacticDottyJS/publishLocal; scalatestDottyJS/publishLocal", + sbtDocCommand = ";scalacticDotty/doc", // fails with missing type ;scalatestDotty/doc" // cannot take signature of (test: org.scalatest.concurrent.ConductorFixture#OneArgTest): // org.scalatest.Outcome // Problem parsing scalatest.dotty/target/scala-3.0.0-M2/src_managed/main/org/scalatest/concurrent/ConductorFixture.scala:[602..624..3843], documentation may not be generated. // dotty.tools.dotc.core.MissingType: + dependencies = List(scalaXml), + testOnlyDependencies = () => List(scalatestplusJunit, scalatestplusTestNG) ) lazy val scalatestplusScalacheck = SbtCommunityProject( @@ -311,7 +313,8 @@ object projects: lazy val scalaXml = SbtCommunityProject( project = "scala-xml", - sbtTestCommand = "xml/test", + sbtTestCommand = "xml/test", + sbtPublishCommand = "xml/publishLocal", sbtDocCommand = "xml/doc" )