Cruise Control and PHP projects
Asked Answered
P

4

8

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

Pavier answered 1/12, 2008 at 11:5 Comment(0)
L
2

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

Lagrange answered 1/12, 2008 at 16:57 Comment(1)
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.Pavier
C
1

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.

Cater answered 5/2, 2012 at 10:43 Comment(0)
C
0

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?

Culbreth answered 3/12, 2008 at 11:1 Comment(0)
T
0

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.

Therron answered 10/12, 2008 at 17:29 Comment(1)
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.Therron

© 2022 - 2024 — McMap. All rights reserved.