I'm working on a pure Java project with playframework 2.3 and using Jacoco4sbt as code coverage tool.
What should I do in order to get the build fail when code coverage is below a threshold ?
In your project's build.sbt
file just add the following
jacoco.settings ++ Seq(
jacoco.thresholds in jacoco.Config := Thresholds(
instruction = 90,
method = 90,
branch = 90,
complexity = 90,
line = 90,
clazz = 90)
)
And run at your project's root activator jacoco:cover dist
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With