Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala sbt:如何运行集成测试_Scala_Sbt_Integration Testing - Fatal编程技术网

Scala sbt:如何运行集成测试

Scala sbt:如何运行集成测试,scala,sbt,integration-testing,Scala,Sbt,Integration Testing,根据报告: 标准测试任务可用,但必须加前缀 它:。比如说, >IntegrationTest/testOnly org.example.AnIntegrationTest 如上所述,我将其添加到我的build.sbt: lazy val server = (project in file("server")) .configs(IntegrationTest) 我只想运行集成测试 因此,我尝试了不同的方法,但都不奏效: [IJ][play-binding-form-server] $ it

根据报告:

标准测试任务可用,但必须加前缀 它:。比如说,

>IntegrationTest/testOnly org.example.AnIntegrationTest

如上所述,我将其添加到我的
build.sbt

lazy val server = (project in file("server"))
  .configs(IntegrationTest)
我只想运行集成测试

因此,我尝试了不同的方法,但都不奏效:

[IJ][play-binding-form-server] $ it:test
[error] No such setting/task
[error] it:test
...
[IJ][play-binding-form-server] $ IntegrationTest / testOnly org.example.AnIntegrationTest
[error] Expected whitespace character
[error] Expected '/'
[error] IntegrationTest / testOnly org.example.AnIntegrationTest

如何正确操作?

您需要像这里一样启用
设置(Defaults.itSettings)

lazy val server = (project in file("server"))
  .configs(IntegrationTest)
  .settings(Defaults.itSettings)
在此之后,您应该能够在sbt中同时运行这两个功能

sbt> it:testOnly test.Spec
sbt> IntegrationTest / testOnly test.Spec
或在
sbt
as之外

sbt "it:testOnly test.Spec"
sbt "IntegrationTest / testOnly test.Spec"
谢谢
.settings(默认值.itSettings)
是缺少的部分!