Nick Sieger: Continuous Integration Goodness(TM) for Your Ruby Projectdo what you lovetag:blog.nicksieger.com,2005:TypoTypo2007-08-31T18:01:47+00:00Simon Harrisurn:uuid:1e8321e8-0127-4737-8e73-a7b55b62af572007-03-16T12:49:14+00:002007-08-31T18:01:47+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Simon Harris<p>Rock on! Just integrated my rails plugins with Pulse. Sweet!</p>Nickurn:uuid:ebac2a3b-427b-42cc-b703-7bc03fd283592007-02-03T01:41:59+00:002007-08-31T18:01:46+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Nick<p>@Chaskunz: All this does is generate an XML file after running your Ruby tests or specs. The files do flag test failures, but it’s up to the CI system to recognize that.</p>Chaskunzurn:uuid:517459a2-2a2a-4382-8faf-f95cd12f960b2007-02-02T21:16:49+00:002007-08-31T18:01:44+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Chaskunzjunit can report whether a test has failed so that CruiseControl can pick that up and tag the build as failed.
<junit failureproperty='junit_test_failed'></junit>
<fail message='One or more JUnit tests failed' if='junit_test_failed' />
Can that be done with your plugin?
Our developers tend to only look at the results page if it’s titled “Build Failed”Slava Imeshevurn:uuid:d925a1db-2806-49c9-a68a-5770e044334c2007-01-08T19:43:56+00:002007-08-31T18:01:44+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Slava Imeshev<p>Nick,</p>
<p>You might also want to check our <a href='http://www.viewtier.com/products/parabuild/index.htm' rel="nofollow">Parabuild</a>. It will with any command line build tool and provides JUnit statistics.</p>Nickurn:uuid:306dbabb-7bad-4c75-90db-3605067e9b6c2007-01-08T03:32:39+00:002007-08-31T18:01:43+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Nick<p>@Mike: Bamboo appears to work pretty well for Ruby right now. There are probably quite a few things (like what I did here) to make the integration tighter and track more items on Ruby and Rails projects (like the output of “rake stats” and possibly rcov coverage data). Detecting and adding a Rake builder would be a nice step.</p>
<p>There’s also potential for JRuby integration – you could ship it and possibly have cross-platform, out-of-the-box Rake support, which would be pretty sweet.</p>
<p>Feel free to email me or come look for me in #jruby on freenode if you want to discuss further.</p>Mike Cannon-Brookesurn:uuid:32d36a3c-b982-44cc-b660-58025f0d91672007-01-07T22:57:22+00:002007-08-31T18:01:42+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Mike Cannon-Brookes<p>Nick - thanks for the plug. Most appreciated! </p>
<p>While I have you, is there anything you think we could do to <em>better</em> support Ruby projects out of the box? I’m sure the team would love to hear about them. </p>
<p>We’re hardly Ruby experts here, but have dabbled quite a bit. I expect the features required by true Ruby houses would be far more useful coming from you than me :)</p>
<p>Thanks again,
Mike</p>Nickurn:uuid:75965671-4d73-4deb-aec3-5da0fcc66a492007-01-07T06:06:03+00:002007-08-31T18:01:41+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Nick<p>@Chris: I haven’t checked out Cerberus yet, thanks for the link. I’ve been using Bamboo because we have a bunch of Java projects to build also.</p>
<p>Thanks for reporting the require issue. How did I miss that?!? Fixed now in svn.</p>Chris Carterurn:uuid:a574a230-9f7d-46ef-8b9e-eff040f684182007-01-07T05:23:27+00:002007-08-31T18:01:41+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Chris Carter<p>Hey, There’s a small issue with it, the test unit reporter does not require ‘ci/reporter/core’ which causes errors.</p>Luke Franclurn:uuid:ee1df35a-d6bb-401a-9348-ce8591fd82af2007-01-06T19:25:41+00:002007-08-31T18:01:41+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Luke Francl<p>Ah, that’s awesome.</p>
<p>I was thinking of doing this so I could use Hudson for doing continuous integration (check it out if you haven’t – it’s awesome, and Free Software, too).</p>
<p>But, now someone did it for us! </p>Chris Carterurn:uuid:2a4784de-fa02-499a-8e47-6d458e1706532007-01-06T19:10:04+00:002007-08-31T18:01:41+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Chris Carter<p>Have you seen <a href='http://cerberus.rubyforge.org/' rel="nofollow">Cerberus</a>?</p>Pat Eylerurn:uuid:318b7eba-6979-409c-97ad-cae41729139f2007-01-06T17:41:27+00:002007-08-31T18:01:40+00:00Comment on Continuous Integration Goodness(TM) for Your Ruby Project by Pat Eyler<p>I’d love to see a gem (since I don’t do any real rails work).</p>Nick Siegerurn:uuid:e3f1c8a2-8050-44b8-a1f5-02cecb0ff92c2007-01-06T15:42:00+00:002007-08-31T18:00:08+00:00Continuous Integration Goodness(TM) for Your Ruby Project<p>As much as we’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’t know a bit about us. One that I’m currently enamoured with is <a href="http://confluence.atlassian.com/display/BAMBOO">Bamboo, Atlassian’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’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’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’s packaged as a Rails plugin, because I’m lazy and I don’t need anything else right now. If you’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’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’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’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>