Entries tagged as phpunitRelated tags ant arbit bug fix continuous integration cruisecontrol git github lint php phpmd phpundercontrol release announcement sebastian marek cyclomatic complexity ipc karlsruhe kore software metrics talks checkstyle design quality npath complexity php_codesniffer php_depend pmd quality assurance css customization dashboard ezcomponents java server pages layout php5 phpdoc testing tutorial cli usability torii portal annotations rule set static code analysis ext/filter phpt unit test apache software foundation book consulting phpugdo qafoo toby zeta components changes company conference crazy dortmund elephpant fabien potencier fun hamburg logger phpbbq phpug pirum quality software architecture software design static_reflection support thinkpad tools training unconference xml xpath zce zend certified engineer optimization performance elger mayflower php_codebrowser thorsten cbo class interface size coupling between objects overview pyramid tokenizer article cologne php-magazin customerSaturday, September 20. 2008Documentation error for "merge-phpunit"
There was a documentation error in the previously presented ant build file for the new
Beside this documentation error, there was a bug in version 0.4.3 related to the same topic, which is fixed now. So please make sure you have the latest version (at least 0.4.4) installed.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
10:51
| Comments (0)
| Trackbacks (0)
Wednesday, September 10. 2008phpUnderControl 0.4.4 bugfix releaseI recently released a bugfix version of phpUnderControl. Beside some minor view errors like the odd/even rows problem, the 0.4.4 release of phpUnderControl fixes a bug in the new merged phpunit logs feature, which doesn't cause CruiseControl to fail for such builds.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
21:10
| Comment (1)
| Trackback (1)
Defined tags for this entry: continuous integration, cruisecontrol, php5, phpundercontrol, phpunit, release announcement
Sunday, September 7. 2008phpUnderControl 0.4.3 releasedI currently released a new version of phpUnderControl. Beside some minor fixes this release comes with a new feature to aggregate test results of multiple PHPUnit runs.
Use the new cli command
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php, projects
at
19:11
| Comment (1)
| Trackback (1)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, phpunit, release announcement
Sunday, July 27. 2008Everything looks fine, but it failsYesterday kore asked me about a strange behavior of phpUnderControl. The last arbit build done by phpUnderControl has failed, but when we looked over the different result pages everything looks fine. Strange! What has happened? After an analysis session of the 6MB XML log file I detected the following self explaining entry. The PHPUnit tests for arbit had completely failed. <?xml version="1.0" encoding="UTF-8"?> <cruisecontrol> ... <build error=".../arbit/build.xml:20: exec returned: 255" time="12 minutes 56 seconds"> ... <target name="phpunit" time="1 second"> <task location=".../arbit/build.xml:20: " name="exec" time="1 second"> <message priority="debug"><![CDATA[Current OS is Linux]]></message> <message priority="debug"><![CDATA[Executing 'phpunit' with arguments: '--log-xml' 'build/logs/phpunit.xml' '--log-pmd' 'build/logs/phpunit.pmd.xml' '--log-metrics' 'build/logs/phpunit.metrics.xml' '--coverage-xml' 'build/logs/phpunit.coverage.xml' '--coverage-html' 'build/coverage' 'arbitTestSuite' 'source/tests/suite.php' The ' characters around the executable and arguments are not part of the command.]]></message> <message priority="info"><![CDATA[Fatal error: main(): Failed opening required 'modules_tracker_suite.php' (include_path='.../arbit/source/src/:.../arbit/source/src/libraries/:.:.../php-5.3-cvs/lib/php') in .../arbit/source/tests/suite.php on line 0]]></message> <message priority="info"><![CDATA[Call Stack:]]></message> <message priority="info"><![CDATA[0.0005 318436 1. {main}() .../php-5.3-cvs/bin/phpunit:0]]></message> <message priority="info"><![CDATA[0.2345 542264 2. require('.../php-5.3-cvs/lib/php/PHPUnit/TextUI/Command.php') .../php-5.3-cvs/bin/phpunit:44]]></message> <message priority="info"><![CDATA[1.0595 5278380 3. PHPUnit_TextUI_Command::main() .../php-5.3-cvs/lib/php/PHPUnit/TextUI/Command.php:528]]></message> <message priority="info"><![CDATA[1.0616 5294940 4. PHPUnit_Runner_BaseTestRunner->getTest() .../php-5.3-cvs/lib/php/PHPUnit/TextUI/Command.php:90]]></message> <message priority="info"><![CDATA[1.0617 5295224 5. PHPUnit_Runner_BaseTestRunner->loadSuiteClass() .../php-5.3-cvs/lib/php/PHPUnit/Runner/BaseTestRunner.php:200]]></message> <message priority="info"><![CDATA[1.0617 5295508 6. PHPUnit_Runner_StandardTestSuiteLoader->load() .../php-5.3-cvs/lib/php/PHPUnit/Runner/BaseTestRunner.php:269]]></message> <message priority="info"><![CDATA[1.0828 5295792 7. PHPUnit_Util_Fileloader::checkAndLoad() .../php-5.3-cvs/lib/php/PHPUnit/Runner/StandardTestSuiteLoader.php:97]]></message> <message priority="info"><![CDATA[1.1736 5296168 8. PHPUnit_Util_Fileloader::load() .../php-5.3-cvs/lib/php/PHPUnit/Util/Fileloader.php:105]]></message> <message priority="info"><![CDATA[1.1746 5328364 9. include_once('.../arbit/source/tests/suite.php') .../php-5.3-cvs/lib/php/PHPUnit/Util/Fileloader.php:120]]></message> </task> </target> </build> ... </cruisecontrol> Ok, the test run failed, but why did phpUnderControl say: All Tests passed?
The answer is really simple. Due to the fact that phpunit died, it didn't generate any log file and previous log files still reside in
At this moment I realized that I have never mentioned a clean-target for the ant
You should add an additional target to your ant <?xml version="1.0" encoding="UTF-8"?> <project name="phpundercontrol.org" default="build" basedir="."> ... <target name="clean"> <!-- Remove old log files --> <delete> <fileset dir="${basedir}/build/logs" includes="**.*" /> </delete> <!-- Remove old api documentation --> <delete> <fileset dir="${basedir}/build/api" includes="**.*" /> </delete> <!-- Remove old coverage report --> <delete> <fileset dir="${basedir}/build/coverage" includes="**.*" /> </delete> </target> <target name="build" depends="clean,checkout,php-documentor,php-codesniffer,phpunit" /> ... </project> That's it. Now you will get the expected(not really) result: No Tests Run - This project doesn't have any tests.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
15:14
| Comments (0)
| Trackback (1)
Defined tags for this entry: ant, arbit, continuous integration, cruisecontrol, phpundercontrol, phpunit
Saturday, February 16. 2008Howto customize phpUnderControl!Due to the fact that every software is individual and in this context the used tools differ from build-process to build-process phpUnderControl 0.3.6 introduced a new feature that allows to customize the main menu bar. It is a simple placeholder based preprocessor. It extracts custom tabs from an existing phpUnderControl installation and takes them into newer version during the update process. At the moment only the main.jsp file supports this new preprocessor between each of the predefined tabs. Each phpUnderControl placeholder has the following format <%-- phpUnderControl ([0-9]+) --%> where ([0-9]+) represents a unique number. The following example shows a section from the main.jsp file as it is shipped with phpUnderControl 0.3.6. ... <cruisecontrol:tab name="log" url="<%=logs_url%>" label="XML Log File" /> <%-- phpUnderControl 4 --%> <cruisecontrol:tab name="metrics" label="Metrics" > <%@ include file="metrics.jsp" %> </cruisecontrol:tab> <%-- phpUnderControl 5 --%> <cruisecontrol:tab name="coverage" label="Coverage"> ... </cruisecontrol:tab> <%-- phpUnderControl 6 --%> <cruisecontrol:tab name="documentation" label="Documentation"> ... Now I would like to add two more documentation types to my build result. The agile Testdox documentation, generated by PHPUnit and the end user documentation generated from docbook xml files in the source repository. <%-- phpUnderControl 4 --%> <cruisecontrol:tab name="metrics" label="Metrics" > <%@ include file="metrics.jsp" %> </cruisecontrol:tab> <%-- begin phpUnderControl 5 --%> <cruisecontrol:tab name="testdox" label="Testdox"> <cruisecontrol:artifactsLink> <iframe src="<%= artifacts_url %>/testdox/testdox.html" width="100%" height="550" /> </iframe> </cruisecontrol:artifactsLink> </cruisecontrol:tab> <cruisecontrol:tab name="manual" label="Manual"> <cruisecontrol:artifactsLink> <iframe src="<%= artifacts_url %>/manual/index.html" width="100%" height="550" /> </iframe> </cruisecontrol:artifactsLink> </cruisecontrol:tab> <%-- end phpUnderControl 5 --%> <cruisecontrol:tab name="coverage" label="Coverage"> ... </cruisecontrol:tab> <%-- phpUnderControl 6 --%> I simply translated the placeholder number 5 into an opening %<-- begin phpUnderControl 5 --%> and a closing <%-- end phpUnderControl 5 --%> placeholder and put my custom tabs between this two comment. And this is what it looks like now. And the best thing is that you do not need to worry about future updates.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
15:32
| Comments (2)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, customization, java server pages, layout, phpundercontrol, phpunit
Tuesday, February 12. 2008phpUnderControl 0.3.6Except minor enhancements and bugfixes the latest phpUnderControl version comes with two new features.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, projects
at
11:19
| Comments (6)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, phpundercontrol, phpunit, quality assurance, software metrics, testing
Saturday, January 19. 2008phpUnderControl 0.3.x releasedYesterday I released version 0.3.(0|1|2) of phpUnderControl. Except bugfixes and enhancements the major change in this new version of phpUnderControl is an ezcGraph replacement of the original cewolf metrics view. For the excellent appearance of the generated graphics I would like to thank kore, who supported me actively with his deep knowledge of the ezcGraph component. Beside the better appearance, the new graph implementation has another advantage, it performs much better than the original cewolf implementation, because cewolf generates graphics in real time, while the new ezcGraph solution generates static graphics during the build process. To integrate the graph generator into your build process, you must alter the <publishers /> elements in the config.xml file. Simply add a CruiseControl execute-publisher that calls the phpUnderControl cli tool with the graph command, as shown in the following example. <cruisecontrol> <project name="php-under-control" buildafterfailed="false"> ... <publishers> ... <execute command="/path/to/phpuc(.php|.bat) graph logs/${project.name}"/> </publishers> </project> </cruisecontrol> The phpUnderControl graph command expects at least the project log directory as argument, it is the directory where CruiseControl stores the merged xml log files. In this default mode phpUnderControl will generate the metric charts for each build into logs/<project-name>/<build-timestamp>/graph directories. If you use a different CruiseControl setup where artifacts are not stored in the logs/ directory you can call the graph command with a second argument that specifies the output directory, for example:
[mapi@arwen /opt/cruisecontrol]$ phpuc graph logs/phpUnderControl \
artifacts/phpUnderControl
Finally I say thanks to Sebastian, because he integrates a new css file for the coverage reports into PHPUnit, that produces a harmonious overall picture between phpUnderControl and the coverage-report. This stylesheet is yet another contribution by kore. All phpUnderControl versions are available thru the phpunit.de pear channel, just type: [mapi@arwen ~]$ pear channel-discover pear.phpunit.de [mapi@arwen ~]$ pear install --alldeps phpunit/phpUnderControl-beta
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
19:45
| Comments (11)
| Trackbacks (0)
Defined tags for this entry: continuous integration, cruisecontrol, css, ezcomponents, php, phpundercontrol, phpunit, quality assurance, testing
Friday, November 23. 2007phpUnderControl updateI have never thought that phpUnderControl would be so interesting to others. From my point of view there were just a view modifications and extensions for the original CruiseControl setup that integrate some common PHP development tools. But the comprehensive and positive feedback told me something else. To my surprise Sebastian Bergmann asked me one day after the initial release to host the project on his PHPUnit website and I accepted his offer gladly. This means for you that you will find further releases of phpUnderControl on the PHPUnit website and in the related subversion repository. With this backing and positive feedback the development of the next phpUnderControl preview version started the same day. Beside some bugfixes and minor changes the latest phpUnderControl version has now a really nice layout, many thanks to kore who spent his time for this layout during the last UG meeting. Beyond these changes this release integrates the build artifacts of PHPUnit and PhpDocumentor into the CruiseControl user interface. For the upcoming release the planning is focused on an integrated project wizard, that allows an easy setup of custom projects, and support for windows.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
22:53
| Comments (4)
| Trackbacks (2)
Sunday, November 18. 2007First release of phpUnderControlThis is the first release of the phpUnderControl tool. This tool aims to take the first steps with CruiseControl and PHP as easy as possible. phpUnderControl integrates three of the best PHP development tools into CruiseControl, combined with an easy setup routine and a small example project. With the provided XSL-Stylesheets the generated output of PHPUnit, PHP_CodeSniffer and phpDocumentor can be visualized in CruiseControl, as you can see in the following screenshot. Getting startedNow let's take a look how to start with CruiseControl and phpUnderControl. The first things you need is a Java environment and a working installation of CruiseControl. I assume that Java is already installed and so I will not cover this topic here, but I suggest to use an original Java version from SUN instead of some versions bundled with linux distributions, because in combination with compiz or beryl the metrics view can be broken. Getting a working CruiseControl installation is a simple task. Just download one of the provided zip archives, unpack the contents and start the application. Because this initial release of phpUnderControl is only tested with CruiseControl 2.7, I suggest to use this version for the moment. You can download this version, if you click the following link: When the download has finished, just unzip the archive. unzip cruisecontrol-bin-2.7.zip -d /opt/ For a detailed installation description how to install CruiseControl and how to configure it with PHPUnit I recommend an excellent article by Sebastian Nohn and the Continuous Integration chapter from the PHPUnit Pocket Guide written by Sebastian Bergmann. Now, that you have a working CruiseControl, download the phpUnderControl tool from the following url and unpack the archive:
Small bugfix release, I left some system() calls in the source code. Now, you need to change to the phpUnderControl/bin directory and execute the following command to install the required files. All files that the command line tool modifies, are backed up with the file extension .orig. [mapi@frodo bin]$ ./phpuc.php install /opt/cruisecontrol-bin-2.7 Modifying CruiseControl files. File "main.jsp" modified. File "metrics.jsp" modified. File "xsl/buildresults.xsl" modified. Installing new CruiseControl files. File "phpcs.jsp" installed. File "phpunit-pmd.jsp" installed. File "xsl/phpcs.xsl" installed. File "xsl/phpcs-details.xsl" installed. File "xsl/phpdoc.xsl" installed. File "xsl/phphelper.xsl" installed. File "xsl/phpunit-pmd.xsl" installed. File "xsl/phpunit-pmd-details.xsl" installed. Modifying CruiseControl stylesheet. Creating backup of "css/cruisecontrol.css" as "css/cruisecontrol.css.orig". All you need now is an application with that CruiseControl can work. phpUnderControl comes with a little example application which can be installed with the following command. This example doesn't require any version control system installation. Instead it uses a special tag, that CruiseControl provides. [mapi@frodo bin]$ ./phpuc.php example -t ant /opt/cruisecontrol-bin-2.7 Creating required project directories. 1. Creating CruiseControl project dir "projects/php-under-control". 2. Creating Project input dir "php-under-control/source". 3. Creating Project source dir "php-under-control/source/src". 4. Creating Project test dir "php-under-control/source/tests". 5. Creating Project build dir "php-under-control/build". 6. Creating Project log dir "php-under-control/build/logs" 7. Creating API documentation dir "/tmp/php-under-control/api" 8. Creating Coverage dir "/tmp/php-under-control/coverage" Creating example files. Creating file "php-under-control/source/src/Math.php". Creating file "php-under-control/source/tests/MathTest.php". Creating project build file "php-under-control/build.xml". Preparing CruiseControl "/opt/cruisecontrol-bin-2.7/config.xml. 1. Loading "config.xml" data. 2. Backup original "config.xml" as "config.xml.orig". 3. Creating new project configuration. Now change to the /opt/cruisecontrol-bin-2.7 directory and execute the cruisecontrol.sh or cruisecontrol.bat script to start CruiseControl. If you open your browser with this url http://127.0.0.1:8080/buildresults/php-under-control you will see something similar to the next screenshot. PHPUnit features integratedAs mentioned in a previous post Sebastian Bergmann integrated support for Software Metrics and PMD in the PHPUnit 3.2 branch. Because he has used the original PMD format, the generated output was usable for CruiseControl without any modifications. Additionaly he integrated a third party contribution for Copy & Paste Detection that makes finding duplicate code fragments much easier. To show the results of this new report type the phpUnderControl tool provides modified versions of the original files pmd.xsl, pmd-details.xsl and metrics.jsp that can visualize the new records. PHP_CodeSniffer integration
The PEAR package PHP_CodeSniffer makes us PHP developers a present. With this handy tool coding guildline checks have become a really simple task. As a positive reaction on an other article Greg Sherwood, the lead developer of PHP_CodeSniffer, added support for the Checkstyle format to this package. Cool :-), with the upcoming 1.0.0RC3 release of PHP_CodeSniffer this package will work together with CruiseControl without any changes. The following screenshot shows the PHP_CodeSniffer result for the phpUnderControl example. Please note, all these errors are provoked and not the result of bad coding PLEASE NOTE: The current version 1.0.0RC2 has a small bug in the checkstyle output that causes CruiseControl to fail with the Checkstyle report. I hope this will be fixed in the RC3 release, but if you cannot wait just change line 720 in <pear-install>/PHP/CodeSniffer.php from echo ' line="'.$line.' "column="'.$column.'"'; to echo ' line="'.$line.'" column="'.$column.'"'; or you apply the following patch to <pear-install>/PHP/CodeSniffer.php Index: CodeSniffer.php =================================================================== RCS file: /repository/pear/PHP_CodeSniffer/CodeSniffer.php,v retrieving revision 1.55 diff -r1.55 CodeSniffer.php 720c720 < echo ' line="'.$line.' "column="'.$column.'"'; --- > echo ' line="'.$line.'" column="'.$column.'"'; or you modify the build.xml file and use the XSL-Stylesheet from my previous post. phpDocumentor integrationDuring the last user group meeting, while all others were hacking on some stuff. I thought this small javadoc legend in the "Coding violations" view must be fillable with the results of the standard PHP documentation tool phpDocumentor. The current integration is based on text matching onto the command line output of the phpdoc script which is not a perfect solution. For a future release of phpUnderControl there will be a custom implementation of the output converter that will process the documentation errors and warnings. FinallyI hope this post and the phpUnderControl tool helps someone and was interesting for some of the readers. The current version is only tested under linux which means that I cannot say anything about windows, so I would be delighted if someone provides windows phpuc.bat or phpuc.cmd file.
Posted by Manuel Pichler
in php, phpugdo, phpundercontrol, planet-php
at
16:41
| Comments (5)
| Trackback (1)
(Page 1 of 1, totaling 9 entries)
|
ProjectsFurther stuffCategories |

