sbt multi-module project: inter-dependency of integration tests

1.1k views Asked by At

I have a multi-module sbt project with integration tests for each module. Module a depends on module b for compile, test, and integration test scope. So I have it setup like this in a Build.scala:

lazy val authorizationdeciderservice = Project(
  id = "a",
  base = file("modules/a"),
  configurations = Seq(IntegrationTest),
  dependencies = Seq(b % "compile;it->test;it")
)

Now the compile and it->test dependency work fine, but the it dependecy does not, in that I am unable to access resources on the it path in b from integration tests in a.

What might the issue be?

2

There are 2 answers

0
tilde On

Using "it->it" wasn't working for me in sbt 1.8.0. I was able to make it work with "test->it". This has the downside of making "b"'s integration test code available in "a"'s regular tests, but it at least avoids the code duplication I would have done. Eventually I'll move to the recommended separate sub-project for integration tests, per sbt 1.9.0's release notes.

2
Konstantin Pelepelin On

b % "compile;it->test;it" is the same as b % "compile->compile;it->test;it->compile". To access resources on the it path in b from integration tests in a, there should be "it->it".