5

I'm using sbt scoverage 1.3.5 (Scala 2.11.8) and I have a bunch of classes that I do not want to include the the coverage reports. In particular the base classes and their tests are located in com/corp/something/something_else in both main and test. I have added the following lines to my buld.sbt:

coverageEnabled := true
coverageMinimum := 90
coverageFailOnMinimum := true
coverageExcludedPackages := """com.corp.something.something_else.*;"""

I have tried it with single quotes and \\. in place of the dots, with and without the final .* and with and without the final semicolon but so far when I run sbt clean coverage test coverageReport the report contains everything and it does not exclude the packages I have listed. What am I missing?

Perhaps in a similar vein is that the coverage report does not fail even though across all packages the coverage is below 90% and it should fail based on the option I set, right?

Max Power
  • 952
  • 9
  • 24
  • Would it be possible that you were maybe running in a `sbt` session without reloading the build file after each edit? – stefanobaghino Jun 14 '17 at 08:41
  • No. Even with an explicit reload, the HTML coverage report still gets created for all packages and it does not fail when the coverage falls below the minimum. – Max Power Jun 14 '17 at 12:19
  • I've created a simple project with a similar setup and it works. Could you provide something not working for testing? BTW, don't add `coverageEnabled := true` to `build.sbt`, this parameter is turned on by `coverage` command. – Grzegorz Slowikowski Jun 15 '17 at 20:13

0 Answers0