Pregunta

This is actually a duplicate of sorts of Setting up actions for multiple test folders in SBT, however the answer in that one specifically uses the Scala syntax for SBT.

In our project - currently at SBT 0.10.1, but I hope we can upgrade to 0.11 soon - we use the 'simple' configurating using SBT's own DSL.

How can I create separate testing tasks / commands in SBT for different folders? In my specific case, I'd like a batch of regular unit tests and a batch of integration tests.

A secondary question, is it possible - with SBT - to alter a Java property? For the integration tests, I'd like to set a property called 'env' to 'testing' (or 'integration-testing' soon), so that a different MongoDB database is accessed. When starting up the application, I can do this using -Denv=testing, but is it possible to do this in SBT instead?

¿Fue útil?

Solución

You can use the simple configuration in conjunction with the Scala-based configuration, details are here. So you should be able to use the advice in the other question and leave your build.sbt untouched or only make minimal changes. I do this dual configuration frequently to define sub-projects and project dependencies, but keep the simplicity of adding library dependencies.

As for your second question, maybe you should make that a separate question, as I would like to know that as well :)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top