views:

1730

answers:

4

Hi,

I'm looking for a complete solution to a automated "building" and testing of PHP application. I came across PhpUnderControl, a solution for running automated application builds created around Cruise Control.

Unfortunately PhpUC is still in it's early stages of development and I can't get it to work on windows box.

After few hours of trying I gave up on phpUc. I'm now trying to use Cruise Control alone. It works just fine when it comes to running whole build process. Every command I put into ant's build file runs ok.

The only problem I've got is that Cruise Control won't merge logs from run builds into project log file, therefore I'm not able to see any build results. But the sample project in Cruise control works ok, logs for builds are merged into project's log.

I'm wondering if Cruise Control is able to merge logs created by PHPUnit (in XML format) into project log or is it working for Java's JUnit files only. Has anyone tried to use Cruise Control alone on a php project?

here's the log section of project's configuration (config.xml):

<log dir="logs/${project.name}">
<merge dir="projects/${project.name}/build/logs/"/>
</log>

This is copy-pasted + paths changed from Cruise Control's sample project.

Any thoughts anyone please.

Thanks

+1  A: 

I'm wondering if Cruise Control is able to merge logs created by PHPUnit (in XML format) into project log or is it working for Java's JUnit files only.

CC will merge any xml file you point it at. When you say merging the files isn't working are you getting an error merging them or are the test results not showing up on the results page? If you look at the build log file do you see the test results merged in?

One issue you might be seeing is that the .xsl files in the jsp reporting application are expecting the test results to be in the structure that the ant junit task creates. What might be happening is that you're merging in the files but the .xsl doesn't know how to display the results.

But I think there's a simple solution. The PhpUnderControl project supplies a phpunit.jsp. I think if you add this to your existing CC install you'll be able to view the test results. You can add the phpunit.jsp to the tabs pretty easily; just look at main.jsp and it should be obvious.

If you have any follow-up questions I recommend the CruiseControl users mailing list.

(I haven't used CC on a PHP project but I'm one of the CC committers.)

Jeffrey Fredrick
Thanks for taking time to answer my question, What I mean by 'merging not working' is that no log files are created under cc/logs/project directory after first build. I started over and created new config.xml file and i got it to work. I suppose I messed up config file in some way.
CountZero
A: 

I have found that CruiseControl only merge the logs containing test results when a test fails.

When I broke a test on purpose, the results got merged into the log, and where shown on the CruiseControl dashboard.

Could that be your problem?

Joda
A: 

We tried using PHPUc with CC and we couldn't get the stuff to work right. We experimented with straight CC but found it difficult to get authentication in there (we're distributed, so our reports would be open to the world unless we nailed it down--we couldn't figure it out.)

So, we're now actually using Hudson as our CI engine and Phing as our build tool. It works just fine. We have code coverage reports coming straight out of PHPUnit (which Hudson still calls "Clover coverage" from the Java world, but hey it's just a name of a link and we know what it means).

Hudson was easy to set up and seems to work with everything you'd need for PHP.

Sam McAfee
Since I posted this, we actually did get PHPuc working with Cruise Control and it's all very smooth. I am not the guy who did it, but apparently it can be done. We have code coverage reports with PHPUnit, PMD, CodeSniffer and metrics charts all working. So there is hope.
Sam McAfee
A: 

I think Phing.

Elzo Valugi