Simplecov: Fail if coverage under threshold

Created on 30 Nov 2011  路  8Comments  路  Source: simplecov-ruby/simplecov

In rcov, you can pass in an argument like "--failure-threshold 100" to fail your build if coverage is less than 100%. Am I missing something obvious, or is there no way to easily do this with SimpleCov? Writing a custom at_exit handler sounds a bit painful.

Feature

Most helpful comment

@tcd yes as Christoph pointed out it was released more than 7 years ago: https://github.com/colszowka/simplecov#minimum-coverage

All 8 comments

This is currently not possible, although this is somewhat related to #90. It would be great to have this, scheduled it for 1.0 milestone as it should be fairly easy to implement.

+1 for this. It would be really great to have it.

BTW, here's what I currently do to workaround it.
Dirty, but it works :)

+1, it would be nice.

SimpleCov.at_exit do
  SimpleCov.result.format!
  exit(1) if SimpleCov.result.covered_percent < 90
end

This does the trick but it's not especially neat.

Thanks to @infertux this has arrived in master as the minimum_coverage configuration option and should be out in gem form within the next days.

This is awesome! Any update on release date?

Did this get some sort of resolution?

@tcd yes as Christoph pointed out it was released more than 7 years ago: https://github.com/colszowka/simplecov#minimum-coverage

Was this page helpful?
0 / 5 - 0 ratings