These are chat archives for etorreborre/specs2

Nov 2016
Edmondo Porcu
Nov 23 2016 12:56
Hello, how does one configure SBT to run only the IndexSpec.scala and ignore the others?
Edmondo Porcu
Nov 23 2016 16:22
Thanks @etorreborre the Index functionality doesn't work well in multi-module projects because sbt runs from root
Edmondo Porcu
Nov 23 2016 16:31
also when we create an index using LINK functionality, the output of the other specs is not printed to the screen
Andrea Bessi
Nov 23 2016 16:41
@etorreborre @edmondo1984 same issue here: when we run 'index', we can't see the output of the linked specs. Apparently, only the output of 'index' is shown
Eric Torreborre
Nov 23 2016 21:47
@edmondo1984 @Vincibean do you have any suggestions? How can I help you? Maybe if you create a small project reproducing your setup I can see what I can do
Matthew de Detrich
Nov 23 2016 22:09
@etorreborre This may be a bit out of the question, but would compiling the latest release of Specs2 2.x for Scala 2.12.x be reasonable?
I would offer doing a pull request for it, but I would like to know if its feasible and if there are any other objections
I am trying to get some other libraries in the Scala ecosystem to be compiled for 2.12.0 and some of them still depend on Specs2 2.x
Edmondo Porcu
Nov 23 2016 22:14
@etorreborre you just need to apply what the documentation says
about creating an index for a set of specification.
Maybe I should give you a little bit more background, we are executing a set of services which require a microservice to be up. So we don't want to use BeforeAfterAll in each specification, because it wastes significant test time. We created a single configuration, which looks like so:
class Index extends Specification{

    def is = examplesLinks("MyModule")

    def examplesLinks(t: String) = {
      val absolutePath = new File("submodule/src/test/scala")
      t.title ^ specifications(
        basePath = DirectoryPath.unsafe(absolutePath),
        verbose = true
      ).map(s => link(s)) ^ step(MicroService.stop())

notice that the microservice is instantiate as a val in MicroService object so everything works fine. we have the two following issues. Running this from SBT (after excluding all the other specs) works great, it shows the right number of examples count at the end, although it doesn't show the output of every single spec
I was wondering, maybe we should not exclude the other specs from SBT run (we used a filter as in the previous discussion)