Skip to content

JUnit Tests Ignored when Forking is Enabled #80

@malaverdiere

Description

@malaverdiere

I have a Java project that I'm building with SBT. The only Scala code is in the tests.
I need to run some slow tests in a separate process, with a high memory option (-Xmx).
I want to do that using forking. However, this does not work, as JUnit tests are ignored.

This is an excerpt of my build.sbt:

crossPaths := false
scalaVersion := "2.12.4"
autoScalaLibrary := false
sbtVersion := "1.1.1"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.3" % "test"
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.5" % "test"
libraryDependencies += "junit" % "junit" % "4.12" % "test"
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q")
Test / parallelExecution := false

This configuration makes my jUnit tests run when I do sbt test.
If I add fork in Test := true, then only my ScalaTest tests execute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions