Search code examples
scalasbtspecs2jacoco

jacoco4sbt is not "detecting" my tests. Any idea why?


I have a typical sbt (0.13) build and have added the jacoco4sbt plugin to my build.

addSbtPlugin("de.johoop" % "jacoco4sbt" % "2.1.1")

I use specs2 to run my tests (2.2.2).

If I run

~>sbt
>test

all my tests get run (120 of them). However, if I do

>jacoco:test

it runs 0 tests, as if the jacoco configuration cannot find them.

A quick search reveals that there is an issue with jacoco4sbt and Play because Play sets parallelExecution to false. However, I am not using Play, and parallelExecution is set to True for both configurations. I have tried to set them both to false to no avail.

Any idea what might be going wrong?

n.b. The project I am working on is open source, so I created a branch where I put my attempt at adding jacoco4sbt. Feel free to clone it and see what is happening for yourself.

https://github.com/jedesah/scala-codesheet-api/tree/jacoco


Solution

  • I had this issue, but upgraded to Specs2 2.2.3 and jacoco4sbt started producing output from that point.