Failing Your Builds with RCov - No Fluff Just Stuff

Failing Your Builds with RCov

Posted by: Aaron Bedra on August 7, 2009

Failing Your Builds with RCov

07 Aug 2009

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!

Aaron Bedra

About Aaron Bedra

Aaron Bedra is a Senior Engineer at DRW, where he works at the intersection trading and technology. He has served as a Chief Security Officer, Chief Technology Officer, and Principal Engineer/Architect. He has worked professionally on programming languages, most notably Clojure and ClojureScript. Aaron is the creator of Repsheet, an open source threat intelligence toolkit. He is the co-author of Programming Clojure, 2nd and 3rd Edition and a contributor to Functional Programming: A PragPub Anthology.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »