Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cruise Control and PHP projects

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

like image 834
CountZero Avatar asked Dec 01 '08 11:12

CountZero


2 Answers

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.)

like image 117
Jeffrey Fredrick Avatar answered Sep 29 '22 10:09

Jeffrey Fredrick


phpunit, phpUnderControl and CC work great!

For getting the tests in the tab (phpUnderControl with CC) in the phpunit xml file ensure that the phpunit log file generated is in the correct path

  <log type="junit" target="...../cruisecontrol-bin-2.8.4/projects/<projname>/build/logs/logfile.xml" logIncompleteSkipped="false"/>

Once the logfile.xml is generated from phpunit tests are shown in the tests tab of both phpUnderControl and CC.

like image 35
VDH Avatar answered Sep 29 '22 11:09

VDH