gpt4 book ai didi

Scala 集成测试 "No such setting/task"

转载 作者:行者123 更新时间:2023-12-04 17:40:17 24 4
gpt4 key购买 nike

集成测试配置对我来说是新的。

我无法运行我的 scalatest 集成测试(在 sbt 或 intellij 上)。

我的单元测试在 src/test/scala运行良好。

我的集成测试在 src/it/scala
如果我运行 sbt it:test错误是“没有这样的设置/任务”

如果我在 intellij 上运行(即使用“运行”按钮),我会得到

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/xxx/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"

最佳答案

您尚未添加集成测试配置。

例如,添加 it在 Scala 测试或默认设置等中。

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

对于所有集成,设置 refer

我希望,它会有所帮助。

关于Scala 集成测试 "No such setting/task",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54818759/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com