【发布时间】:2018-06-12 01:16:58
【问题描述】:
我在 Play Framework 应用程序中运行单元测试时遇到问题。
我目前正在使用 v 2.6.11 of Play 和 sbt 0.13.17。过去测试有效,但现在sbt 似乎无法执行。
如果我只是运行sbt test,我会得到No tests were executed.。如果我以sbt --debug 开头sbt,我会得到一个更详细的日志,其中包含以下内容:
[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...
这是我的build.sbt 文件:
我尝试按照this thread in Github添加crossPaths := false
自从我在Missing Implementations 上看到该消息后,我已将此消息添加到我的build.sbt(通过各种谷歌搜索):
"org.scalatest" %% "scalatest" % "3.0.5" % Test,
"com.novocode" % "junit-interface" % "0.11" % Test,
"org.exparity" % "hamcrest-date" % "2.0.0" % Test
但没有运气。整个上午我都在各种 Stackoverflow 线程和 github 问题this、this 或 this
如果有人对我如何调试这种情况有一些想法。
【问题讨论】:
标签: unit-testing playframework sbt