Failing Your Builds with RCov
I just pushed the latest bits to RCov, and they include a new option to help you fail in more spectacular ways! Have you ever made sure that your build fails if you don’t satisfy the coverage threshold? If you are in RSpec land, you have always been able to use the built in verify_rcov
task, but if you are using any of the other testing frameworks, it has historically been quite a process.
To use the new hotness, simply add --failure-threshold xx
where xx
is the threshold you want your coverage to be at. If your coverage drops below that threshold you will get a message telling you, but more importantly your build will actually fail. RCov exits non-zero when you fail to satisfy the coverage threshold which means that your Continuous Integration builds will fail. Having this in your bag of tricks is an awesome thing, and can help ensure that everyone is checking in tests along with their code.
To get the latest RCov bits simply run:
gem install relevance-rcov -s http://gems.github.com
You should get at least version 0.8.5. The --failure-threshold
option will be included in RCov 0.8.5 and higher. As always, if you have any issues please report them to the RCov issue tracker and I will be sure to take a look. If you are going to submit a bug, check out this tasty groove that will give you some tips on how to properly submit a bug report for RCov. Enjoy your Whales!