Symfony Continuous Integration

A few evenings of work after starting on this project, I've got a working proof of concept since tonight. This working proof of concept means that I have phpUnderControl execute my tests, read in the resulting XML and display the test information in the phpUnderControl web interface as it would with phpUnit tests.


So how does this currently work. For this proof of concept, I've borrowed big pieces of code from the test:all task. I created a new task (test:undercontrol) which basically takes the output of test:all and analysis it for all required information. Based on this information, it builds an XML string that is then written to a path that is given as task parameter.

In your phpUnderControl, you create a new project as you always would. Instead of running phpUnit to test your code, you configure the build.xml to run

symfony test:undercontrol /path/to/cruisecontrol/projects/symfony/build/logs/phpunit.xml

Once phpUnderControl is triggered to build the project, it now gets all information it needs to display the test information in the web interface.

Not done though

This is just a proof of concept. With my work so far, I've proven that I can get symfony to spit out the required XML format so that phpUnderControl can parse and display this information. But this does not mean I'm done.

The test:all output is a summary of the actual test output, and as such does not contain all information that the XML needs. Right now, I added dummy information for those parts that I could not parse from the information I was getting. This will need to be rewritten so I can get more information from the tests and ensure that I get as much as possible the information required. And overall, the code needs a cleanup before I make it available to the general public.


Once I do get this all cleaned up, I will be able to easily share it as a symfony plugin. This plugin, which currently goes by the working title of 'symfonyUnderControlPlugin', will contain the earlier mentioned test:undercontrol task, which is enough to get this working. Right now, I'm working on getting it to work with symfony 1.1, but with the imminent release of symfony 1.2, I will probably also start working on a symfony 1.2 version quickly after the 1.1 version is released. Backporting to 1.0 is also on my list, but with a lower priority.


Interested in this plugin? I have so far been reporting my progress to the symfony-devs mailinglist, and will continue to do so. That mailinglist is quite interesting anyway, so if you do anything with symfony, join it anyway :)