scala集成测试“没有这样的设置/任务”

9gm1akwq  于 2021-07-14  发布在  Java
关注(0)|答案(1)|浏览(360)

集成测试配置对我来说是新的。
我无法运行scalatest集成测试(在sbt或intellij上)。
我的单元测试 src/test/scala 运行良好。
我的集成测试正在进行中 src/it/scala 如果我和你一起跑 sbt it:test 错误是“没有这样的设置/任务”
如果我在intellij上运行(即,使用“run”按钮),我得到

Unable to load a Suite class. This could be due to an error in your runpath. Missing class: xxx.tools.es_ingester.EsIntegrationSpec
java.lang.ClassNotFoundException: xxx.tools.es_ingester.ConfluenceEsIntegrationSpec
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)

然而,这门课显然很有趣 /src/it/scala//tools/es_ingester .
更新:build.sbt

name := "xxx.tools.data_extractor"

version := "0.1"

organization := "xxx.tools"

scalaVersion := "2.11.12"

sbtVersion := "1.2.7"

libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.5"
libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.5" % "test"
libraryDependencies += "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.5"
libraryDependencies += "ch.qos.logback" % "logback-core" % "1.2.3"
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.25"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3"
libraryDependencies += "org.apache.logging.log4j" % "log4j-core" % "2.11.2"
libraryDependencies += "commons-io" % "commons-io" % "2.6"
libraryDependencies += "org.bouncycastle" % "bcprov-jdk15on" % "1.61"
libraryDependencies += "org.mockito" % "mockito-core" % "2.24.0" % Test
libraryDependencies += "com.typesafe" % "config" % "1.3.3"
libraryDependencies += "com.typesafe.play" %% "play" % "2.7.0"
libraryDependencies += "org.elasticsearch.client" % "elasticsearch-rest-client" % "6.6.0"
libraryDependencies += "org.elasticsearch" % "elasticsearch" % "6.6.0"
libraryDependencies += "org.elasticsearch.client" % "elasticsearch-rest-high-level-client" % "6.6.0"
libraryDependencies += "org.jsoup" % "jsoup" % "1.11.3"
jv4diomz

jv4diomz1#

您尚未为集成测试添加配置。
例如,添加 it 在scala测试或默认设置等。

"org.scalatest" %% "scalatest" % "3.0.5" % "it, test"

有关所有集成,请参阅设置
我希望,这会有帮助。

相关问题