Posts Tagged ‘cent os’

Using Hudson in VirtualBox for multi OS testing

February 8th, 2010

For a small project I currently work on I wanted to run my unit test suites on different operating systems.

Since I work on a Mac and wanted to also run tests on Linux, Virtual Box was exactly what I needed.

Preparing the guest

Just create a new virtual machine, for my project I created a CentOS guest. Install CentOS and configure it like you want. Install the guest additions as well, you will have to install quite a few extra packages in order to get these additions working but the install script is verbose enough to tell you what to install.

Preparing the shared folder

In your VM configuration, just create a new shared folder which points to the project you work on, ideally in read-only mode.
You can now mount the shared folder on the guest, like this:

sudo mkdir /mnt/shared/folder

Add the following line in your /etc/fstab

shared-folder-name /mnt/shared/folder vboxsf defaults 0 0

You can now mount the shared folder by simply running:

sudo mount shared-folder-name

Installing Hudson

You should now have a working guest with CentOS. Just install hudson by using the native packages available.

Configuring Hudson

Create and configure a new job like you would normally do for any normal hudson job.

Below is the configuration for my project, please note that I use the mercurial plugin and the clover plugin.

  • Project name : my project
  • SCM : mercurial, repository : /mnt/shared/folder with @hourly build
  • Run the following ant targets : rununittests, runcodingstandardcheck, generatecodecoveragereportclover
  • Publish code coverage report : checked in path ci/codecoverage with file ‘clover’
  • Activate Chuck Norris : yes (what would be a hudson job without the Chuck Norris plugin ^_^)

Here is a screenshot of the result:

By using such a guest VM I am able to test on 2 different systems, Mac OS ( the host ) and Linux ( the guest ). Next step, test on an Open Solaris guest :)

‘Hope that helps :)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)