Posts Tagged ‘symfony 2.0. symfony 1.0’
Setting up a symfony project with PHPUnit on Hudson
October 26th, 2010
We are using Hudson now for several months as Continous Integration System. This short article describes how we have configured a hudson project for a symfony 1.4 project. I am assuming that the reader is already used to Hudson and knows how a normal project has to be configured.
PHPUnit is the test framework of our choice (surprise, surprise) and we are using the sfPHPUnit2Plugin for all our projects. If you do not now this plugin you may first read another post where the usage and features are described in detail.
All requirements in short:
* Hudson has to be installed
* Hudson plugin xUnit Plugin has to be installed
* the symfony project needs the sfPHPUnit2Plugin
* PHPUnit has to be installed on your test server
Ok, here the configuration steps of the hudson project:
1. Configure your project
Configure standard settings for a hudson project like source-code management settings or email notifications. Please check the official docs if you do not know how to handle this.
2. Add a shell build step
Building a symfony project in a test environment is pretty easy. With the help of some shell commands the project is completely configured and ready for testing. Those shell commands may be entered in the build step section of the hudson project. Defining the correct commands is the main part during the configuration process.
Our configuration looks like this:
1. cd $WORKSPACE/trunk
2. sh _deployment/install_test.sh
3. php symfony cc
4. php symfony phpunit:test-all –configuration –options=”–log-
5. junit=build/testresult_$BUILD_NUMBER.xml” cd build
6. ln -s -f testresult_$BUILD_NUMBER.xml currentTestResult.xml
1. Jump in the project root of the project
2. Install the project on the test server with the help of a internal shell script. This step includes for example the generation of the databases.yml.
3. Clear the symfony cache (always a good choice)
4. Run all PHPUnit tests including unit and functional tests. The test result is written in a jUnit compatible logfile (needed for the xUnit Plugin).
5. Jump in the build directory, which is internally used by Hudson
6. Symlink the latest testresult
3. Configure Post-Build-Action
After the xUnit Plugin is installed correctly, an additional PHPUnit Pattern field should be displayed in the post build action section. In this field has to be entered:
1 trunk/build/currentTestResult.xml
The options “Fail the build if test results were not updated this run” and “Delete temporary JUnit file” should be both checked.
The xUnit Plugin takes the currentTestResult.xml file, which was previously created with the help of the sfPHPUnit2Plugin and analyzes it. When everything works fine, you should be able to review the created test reports.
Here some screenshots how this result could look like.
Trend graph of the test results:
You can find the original post here : http://dev.esl.eu/blog/category/symfony/
Tags: download symfony1.2, hudson, symfony, symfony 2.0. symfony 1.0, symfony development, symfony phpunit on hudson
Posted in symfony | Comments Off
symfony 2.0
July 6th, 2009
hello readers,
today i w’ll tell you about symfony 2.0 upcoming version of symfony after sucess of symfony 1.0 and 1.2,
One thing is very intersting in symfony 2.0 is it’s more faster then old versions.
also many features updated and change in controlorrs and many more …
if you want to know more about symfony 2.0 then click here
enjoy,
kiran
Tags: symfony 2.0. symfony 1.0, symfony web development, web development
Posted in php development, symfony, web development | Comments Off


