3

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

3
  • Do you have fork in test := true by any chance?
    – Eric
    Oct 5, 2013 at 0:55
  • Certainly not explicitly. But I can try forcing it to false and see what happens. Let me get back to you on what comes of it.
    – jedesah
    Oct 5, 2013 at 4:44
  • Tried setting it explicitly to false, but to no avail. Still no tests are being executed by the jacoco:cover or jacoco:test tasks.
    – jedesah
    Oct 7, 2013 at 23:48

2 Answers 2

1

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

0

For what it's worth, I had the same problem when using specs2. When I switched to ScalaTest, jacoco4sbt started detecting my tests.

I have a very basic configuration too, so I don't know we're missing something or if there's something wrong in the current jacoco4sbt version. I did try version 2.1.0 of jacoco4sbt but had the same results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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