sbt-docker-compose icon indicating copy to clipboard operation
sbt-docker-compose copied to clipboard

dockerComposeTest doesn't include parent test scope in dependency classpath

Open walmaaoui opened this issue 4 years ago • 0 comments

When I have a module test-util, where I define an object object Util {..}.

then in the build.sbt second module I depend on the the first module dependsOn(`test-util`) % "compile->compile;test->test" And reuse its object Util in my docker compose tests.

That would compile bu when running dockerComposeTest on the child module, I got an

Class Not Found Exception Util

I managed to make it work by overriding

testDependenciesClasspath := {
  val fullClasspathCompile = (fullClasspath in Compile).value
  val fullClasspathTest = (fullClasspath in Test).value
  (fullClasspathCompile.files ++ fullClasspathTest.files).map(_.getAbsoluteFile).mkString(":")
}

1- May be there are a subset of fullClasspath that would be enough to include the parent test scope in classpath 2- Do you think that this could be included in the default conf?

walmaaoui avatar Dec 02 '20 11:12 walmaaoui