3
votes

Integration test configuration is new to me.

I cannot get my scalatest integration tests to run (on sbt or intellij).

My unittests in src/test/scala run fine.

My integration tests are in src/it/scala

If I run with sbt it:test the error is "No such setting/task"

If I run on intellij (i.e., with the 'run' button), I get

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)

The class, however, is clearly in /src/it/scala/xxx/tools/es_ingester.

update: 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"
1
Could you please show your build.sbt?Mahesh Chand
Updated :) Thanks a million for your attentionJake

1 Answers

1
votes

You have not added configuration for integration test.

For example, adding it in scala test or default settings etc.

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

For all integration, settings refer

I hope, it will help.