9

I use the sbt plugin scoverage to generate test coverage reports for my scala project. However, I'm unable to combine the test reports for unit tests and integration tests.

Here are the commands I run

sbt coverage test // to run unit tests
sbt coverage it:test // to run integration tests
sbt coverageReport // to generate coverage report

In the case above, I only get the coverage report for integration tests.

Question

  • How do I generate a report that aggregates results from both the unit tests as well as the integration tests?

Thanks in advance.

jithinpt
  • 1,204
  • 2
  • 16
  • 33
  • 1
    It just should work (I've just tested on dummy project). BTW, you can combine all tasks in one call `sbt coverage test it:test coverageReport`. I cannot help you without seeing your project. – Grzegorz Slowikowski Feb 10 '17 at 10:18
  • How did you configure the scoverage for scala using SBT ? I need to do it for my project from scratch. Any pointers will be appreciated. – Yathish Manjunath Nov 15 '17 at 08:55

1 Answers1

3

The issue was that I was running sbt clean after running the unit tests and before running the integration tests.

So, the commands as listed above, should generate the combined coverage report.

jithinpt
  • 1,204
  • 2
  • 16
  • 33