Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Run Reactive Streams tests with ScalaTest
The motivation for using sbt-testng-interface originally was to be
independent of Scala versions with a pure Java solution but this
back-fired because the actual interface implementation of
sbt-testng-interface is actually written in Scala. In order to build on
Scala 2.12 milestones, we are switching to ScalaTest for running the
TestNG tests. It has the same binary compatibility issues in theory but
there are builds available for Scala 2.12 milestone releases.
  • Loading branch information
szeiger committed Oct 2, 2015
1 parent 20aed4c commit ef65d0b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 64 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ target/
/test-dbs/*_*
/test-dbs/databases.properties
/test-dbs/testkit.conf
/test-output/
*.log
*.iml
*.pyc
Expand Down
21 changes: 10 additions & 11 deletions project/Build.scala
Expand Up @@ -9,24 +9,24 @@ import com.typesafe.tools.mima.plugin.MimaKeys.{previousArtifact, binaryIssueFil
import com.typesafe.tools.mima.core.{ProblemFilters, MissingClassProblem}
import com.typesafe.sbt.osgi.SbtOsgi.{osgiSettings, OsgiKeys}
import com.typesafe.sbt.sdlc.Plugin._
import de.johoop.testngplugin.TestNGPlugin._

object SlickBuild extends Build {

val slickVersion = "3.2.0-SNAPSHOT"
val slickExtensionsVersion = slickVersion // Slick extensions version for links in the manual
val binaryCompatSlickVersion = "3.2.0" // Slick base version for binary compatibility checks
val scalaVersions = Seq("2.11.7")
val scalaVersions = Seq("2.11.7", "2.12.0-M2")

/** Dependencies for reuse in different parts of the build */
object Dependencies {
val junit = Seq(
"junit" % "junit-dep" % "4.10",
"com.novocode" % "junit-interface" % "0.11"
)
val testngExtras = Seq(
"com.google.inject" % "guice" % "2.0"
)
def scalaTestFor(scalaVersion: String) = {
val v = if(scalaVersion == "2.12.0-M2") "2.2.5-M2" else "2.2.4"
"org.scalatest" %% "scalatest" % v
}
val slf4j = "org.slf4j" % "slf4j-api" % "1.7.10"
val logback = "ch.qos.logback" % "logback-classic" % "1.1.3"
val typesafeConfig = "com.typesafe" % "config" % "1.2.1"
Expand Down Expand Up @@ -311,15 +311,14 @@ object SlickBuild extends Build {
) dependsOn(slickProject)

lazy val reactiveStreamsTestProject = Project(id = "reactive-streams-tests", base = file("reactive-streams-tests"),
settings = Defaults.coreDefaultSettings ++ sharedSettings ++ testNGSettings ++ Seq(
settings = Defaults.coreDefaultSettings ++ sharedSettings ++ Seq(
name := "Slick-ReactiveStreamsTests",
unmanagedResourceDirectories in Test += (baseDirectory in aRootProject).value / "common-test-resources",
resolvers += Resolver.sbtPluginRepo("releases"),
libraryDependencies ++=
(Dependencies.logback +: Dependencies.testDBs).map(_ % "test") ++:
Dependencies.reactiveStreamsTCK +:
Dependencies.testngExtras,
testNGSuites := Seq("reactive-streams-tests/src/test/resources/testng.xml")
libraryDependencies += Dependencies.scalaTestFor(scalaVersion.value),
libraryDependencies ++= (Dependencies.logback +: Dependencies.testDBs).map(_ % "test"),
libraryDependencies += Dependencies.reactiveStreamsTCK,
parallelExecution in Test := false
)
) dependsOn(slickTestkitProject)

Expand Down
14 changes: 0 additions & 14 deletions reactive-streams-tests/src/test/resources/testng.xml

This file was deleted.

Expand Up @@ -5,14 +5,15 @@ import java.util.concurrent.atomic.AtomicInteger
import org.reactivestreams._
import org.reactivestreams.tck._
import org.testng.annotations.{AfterClass, BeforeClass}
import org.scalatest.testng.TestNGSuiteLike

import slick.profile.RelationalProfile

import scala.concurrent.Await
import scala.concurrent.duration.Duration
import scala.util.control.NonFatal

abstract class RelationalPublisherTest[P <: RelationalProfile](val driver: P, timeout: Long) extends PublisherVerification[Int](new TestEnvironment(timeout), 1000L) {
abstract class RelationalPublisherTest[P <: RelationalProfile](val driver: P, timeout: Long) extends PublisherVerification[Int](new TestEnvironment(timeout), 1000L) with TestNGSuiteLike {
import driver.api._

override def maxElementsFromPublisher = 73L
Expand Down

This file was deleted.

0 comments on commit ef65d0b

Please sign in to comment.