Nick Sieger: Tag rake http://blog.nicksieger.com/articles/tag/rake?tag=rake en-us 40 do what you love Continuous Integration Goodness(TM) for Your Ruby Project <p>As much as we&#8217;d like to think we live in a Ruby-glasses-colored world, the fact is there are plenty of neat toys out there that don&#8217;t know a bit about us. One that I&#8217;m currently enamoured with is <a href="http://confluence.atlassian.com/display/BAMBOO">Bamboo, Atlassian&#8217;s new continuous integration server</a>. But, most commercial CI products are aiming for a wider market, and that means Java and Ant. Ant and JUnit predate Rake and Test::Unit by a few years, so I&#8217;m afraid they beat us to the punch, so that now the <a href="http://ant.apache.org/manual/OptionalTasks/junit.html">JUnit Ant task&#8217;s</a> XML format is pretty much the first consideration for a continuous integration server to understand in order to display a test report for a build.</p> <p>Where does that leave us Rubyists who want to play along with the bigs? <a href="http://svn.caldersphere.net/svn/main/ci_reporter">Right here!</a>. With support for not just <a href="http://blog.nicksieger.com/articles/tag/rspec">RSpec</a>, but Test::Unit too.</p> <p>Right now, it&#8217;s packaged as a Rails plugin, because I&#8217;m lazy and I don&#8217;t need anything else right now. If you&#8217;re interested in a gem, please leave a comment. To install into your Rails app, the usual:</p> <div class="typocode"><pre><code class="typocode_default ">./script/plugin install http://svn.caldersphere.net/svn/main/ci_reporter</code></pre></div> <p>That&#8217;s it! Now all you have to do is have your CI server invoke an extra target before the main target that runs your tests.</p> <p>For RSpec,</p> <div class="typocode"><pre><code class="typocode_default ">rake ci:setup_rspec spec</code></pre></div> <p>will leave one XML file per context in the <code>spec/reports</code> directory (creating it if it doesn&#8217;t exist).</p> <p>For Test::Unit,</p> <div class="typocode"><pre><code class="typocode_default ">rake ci:setup_testunit test</code></pre></div> <p>will leave one XML file per test case class in the <code>test/reports</code> directory.</p> <p>Most CI servers have configuration telling them where to look for test reports. Simply plug in one of these directories, and you&#8217;re set. Now sit back and watch your test or spec failures get tracked in your automated builds.</p> <p><img src="/files/test-results.png" alt="test results" title="test results"/></p> Sat, 06 Jan 2007 15:42:00 +0000 urn:uuid:e3f1c8a2-8050-44b8-a1f5-02cecb0ff92c Nick Sieger http://blog.nicksieger.com/articles/2007/01/06/continuous-integration-goodness-tm-for-your-ruby-project ruby continuousintegration junit ant rake http://blog.nicksieger.com/articles/trackback/181