I'm having an issue with running my unit tests in a Play Framework
application.
I'm currently using v 2.6.11
of Play and sbt 0.13.17
. Tests have worked in the past, but It seems that now sbt
cannot execute them.
If I simply run sbt test
I get No tests were executed.
. If I start sbt
with sbt --debug
I get a more verbose log with the following:
[debug] [naha] .
[debug] [naha] All member reference dependencies will be considered within this context.
[debug] [naha] New invalidations:
[debug] [naha] Set()
[debug] [naha] Initial set of included nodes: Set()
[debug] [naha] Previously invalidated, but (transitively) depend on new invalidations:
[debug] [naha] Set()
[debug] [naha] All newly invalidated sources after taking into account (previously) recompiled sources:Set()
[debug] Copy resource mappings:
[debug]
[debug] Framework implementation 'org.scalacheck.ScalaCheckFramework' not present.
[debug] Framework implementation 'org.specs2.runner.Specs2Framework' not present.
[debug] Framework implementation 'org.specs2.runner.SpecsFramework' not present.
[debug] Framework implementation 'org.specs.runner.SpecsFramework' not present.
[debug] Subclass fingerprints: List((org.scalatest.Suite,false,org.scalatest.tools.Framework$$anon$1@1883984e), (junit.framework.TestCase,false,com.novocode.junit.JUnit3Fingerprint@420f0739))
[debug] Annotation fingerprints: List((org.scalatest.WrapWith,false,org.scalatest.tools.Framework$$anon$2@453e6a3d), (org.junit.runner.RunWith,false,com.novocode.junit.RunWithFingerprint@7fb29b6c), (org.junit.Test,false,com.novocode.junit.JUnitFingerprint@7760adb))
[debug] javaOptions: List()
[debug] Forking tests - parallelism = false
[info] ScalaTest
[info] Run completed in 38 milliseconds.
[info] Total number of tests run: 0
[info] Suites: completed 0, aborted 0
[info] Tests: succeeded 0, failed 0, canceled 0, ignored 0, pending 0
[info] No tests were executed.
[debug] Summary for JUnit not available.
[debug] Forcing garbage collection...
This is my build.sbt
file:
lazy val root = (project in file(".")) .enablePlugins(PlayJava,PlayEbean) scalaVersion := "2.11.7" libraryDependencies ++= Seq( javaJdbc, javaWs, javaJpa, filters, guice, // Bunch of Dependencies ) dependencyOverrides ++= Set( "io.ebean" % "ebean" % "11.14.3" withSources() ) // Remove dependencies because of Multiple Bindings to SLF4J excludeDependencies += "org.slf4j" % "slf4j-log4j12" excludeDependencies += "org.log4j" % "log4j" // Don't know why But activator stage started to complain while Compiling // http://stackoverflow.com/questions/22974766/play2-play-stage-command-fails-with-not-found-type-setupcontext sources in doc in Compile := List()
I've tried adding crossPaths := false
as per this thread in Github
Since I saw that message on Missing Implementations
I've added this to my build.sbt
(through various google searches):
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"com.novocode" % "junit-interface" % "0.11" % Test,
"org.exparity" % "hamcrest-date" % "2.0.0" % Test
But without luck. I've been at it all morning in various Stackoverflow threads and github issues this, this or this
If any one has some ideas on how I can debug this situation.