How to break the build if test coverage fails minimum threshold?
Asked Answered
F

1

6

We want to fail the build on codeship if test coverage goes below the threshold value. But it is not failing the build.

Scoverage Plugin:

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.3.5")

Added following two statements in build.sbt

coverageMinimum := 80,
coverageFailOnMinimum := true

It is not failing even in local if test coverage is below 80. The command I run is

sbt clean coverage test coverageReport
Finalist answered 12/5, 2019 at 10:44 Comment(5)
This looks ok... Do you have an example online?Fredella
@ValyDia Example as in? I just run sbt clean coverage test coverageReport. And i expect it should break if coverage fails minimum threshold.Finalist
Sorry I am meant a minimal project that reproduces itFredella
Without example project which exposes the problem we will not be able to help.Hilarity
@GrzegorzSlowikowski Thanks for the reply but the problem has been resolved after updating the plugin version.Finalist
P
4

Try upgrading to version 1.5.1 like so

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
Pit answered 13/5, 2019 at 6:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.