Basic Continuous Integration Server with Symfony and Hudson

February 1st, 2009 | Tags: , ,

This is the absolute minimal setup I was able to find to get a continuous integration server running for Symfony that would report a failed build if any of the project’s unit tests failed. I tried a couple different CI servers and Hudson seemed to be the best mix of easy to install, configure, and use that was also free/open-source.

  1. Install and run Hudson
  2. Navigate to Manage Hudson > Manage Plugins > Available and install the TextFinder plugin
  3. Create a new job in Hudson for your Symfony site
  4. Add an Execute Shell build step with a command of “symfony test:all”. Note: if your project root dir is not your site dir then you will need to first cd to your site dir.
  5. Enable the Hudson Text Finder post-build action with the following settings:
    • Check the Also search the console output checkbox
    • Enter “All tests successful” for the regular expression
    • Check the Succeed if found checkbox

Once this is configured, your builds will fail unless all of your tests pass. The build will also fail if you have no tests. If you have a failed build, you’ll need to look at the build’s console output to determine the failing tests—no fancy test report pages—remember I said this is the absolute minimal setup. This is basically a limitation of Symfony’s built-in Lime unit testing framework (it only outputs to the console). Using Phing combined with PHPUnit or SimpleTest I expect to be able to generate a JUnit-compatible XML file that Hudson has built-in support for.

  1. April 14th, 2009 at 12:58
    Reply | Quote | #1

    If you ever want to read a reader’s feedback :) , I rate this post for four from five. Detailed info, but I have to go to that damn yahoo to find the missed parts. Thanks, anyway!

  2. April 15th, 2009 at 17:07
    Reply | Quote | #2

    What parts would you like to see more detail on?