Continuous Integration with ColdFusion, Hudson, and MXUnit: Getting Started

Thursday, May 28, 2009

This series will demonstrate how to set up a continuous integration (CI) environment for ColdFusion projects using Hudson CI and MXUnit. We’ll cover Hudson setup, MXUnit test runs and JUnit XML output, and a few notification mechanisms (email, IM).

Installing Hudson

This will cover the super-duper simple way to run Hudson, which you'd do for testing this stuff out. DO NOT RUN YOUR REAL CONTINUOUS INTEGRATION ENVIRONMENT IN THIS MANNER. If you already have Tomcat set up, then you know how to install war files so follow that procedure instead (i.e. drop the war where you put your war files, or use the admin to deploy the war. It's that simple)

  1. Download the Hudson war file and put it somewhere
  2. Open a command line and navigate to the war file location
  3. type “java –jar hudson.war”
  4. This will launch Hudson. You can navigate to http://localhost:8080 and from there, you’re ready to start

Pulling your project from Subversion (SVN)

  1. Click "create a new job"
  2. Give your job a name, and then select Freestyle Software Project
  3. Under Source Code Management, select SVN, and then plug in your project’s SVN location, eg http://svn.myproject/whatever/trunk
  4. From here, you can click “Save” and then perform a build by clicking “Build”. This will check out your code into the Hudson workspace for your project

But this code isn’t where I need the code to be! Good point. As I get started with this, I’m going to just keep doing it this way until I figure out a better approach. At least where I work, we have DEV servers where code is automatically updated from SVN anyways, and our unit tests all run against the DEV server. I’m not setting up a CI environment in order to set up yet another server; instead, I’m setting it up so that I can get better reporting and notifications while still executing the same tests against the same code.

Hudson does allow you to choose a “custom workspace”, but I’m not going to get into that right here as I’m not sure yet whether it’s relevant for ColdFusion projects. I can see people being tempted to set the Hudson workspace to an existing project location on a Dev server, for example. Time will tell if this proves to be a good idea

What’s Next?

See how easy that was? Next up, configuring ANT, running your tests, and recording results


Mike Henke said...

Great Stuff. I just blogged about Selenium Remote Control and MXUnit which might fit in great with CI.

Alicia T said...
This comment has been removed by a blog administrator.