2

When I run sbt assembly the tests are not run. How can I make the tests to run before running the assembly task?

1 Answer 1

2

From the documentation at https://github.com/sbt/sbt-assembly#assembly-task:

To run the test during assembly,

lazy val app = (project in file("app"))
  .settings(
    assembly / test := (Test / test).value,
    // more settings here ...
  )
3
  • Thanks! That worked for the app subproject, but the problem now is that I have multiple subprojects and I would like to run tests for all of them. Only app has assembly configured, the others have .disablePlugins(AssemblyPlugin). Commented Dec 8, 2021 at 8:42
  • Why not run explicitly thetm tests then? sbt test assembly for instance.
    – Gaël J
    Commented Dec 8, 2021 at 18:50
  • No other reason, except laziness :-D Commented Dec 9, 2021 at 20:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.