Gave a talk last night at our local Canberra JUG on using Hudson for continuous integration. (Brief slides available, but it was mostly a “demo” style talk… so not much to show)

But to spice it up a little, I used my latest little Groovy project as the demo. I was reading in Groovy in Action about the support Groovy Unit tests have for both IDE integration and coverage tools, so I thought I’d throw that into the mix. Using JUnit from Eclipse works just great…

Groovy with JUnit in Eclipse

I did have some problems getting my tests running from Ant, getting an error like:

groovyc doesn't support the "srcdir" attribute

Which turns out to mean that I’d defined my groovyc task incorrectly. It needed to be:

<taskdef name="groovyc"
    classname="org.codehaus.groovy.ant.Groovyc"
    classpathref="useful.jars"/>

One thing I have been wanting to try out is Cobertura support for Groovy. Turns out to be a snack. The only gotcha is that you must set fork="true" on your JUnit task. If you don’t, all your coverage reports will appear blank (ie with 0% coverage).

Groovy Cobertura in Action

If you haven’t tinkered with Hudson before… it’s definitely time. Everything is configured via the browser, no XML to tinker with, and a it has a great Ajaxy UI.

I wasn’t aware that there is now also an Eclipse plugin for Hudson which can poll your build machine every so often and give you an update on the status of things. Very funky.

Hudson Plugin for Eclipse

It was a really fun talk, and people were pretty impressed with how far Hudson has come in such a short time. Interestingly, only a third of the group was doing CI right now, so it was pretty cool to be able to demo to them the “lunch-time-ability” of getting Hudson installed and configured.

Big props to the Hudson guys… and the Cobertura guys… and, of course, the Groovy guys! Very cool stuff!