I am experimenting with using Jenkins with CakePHP as part of my push towards better CI.
I am using the following command for a build job step.
/var/lib/jenkins/workspace/ABC-MASTER/src/abc/Console/cake testsuite -app
/var/lib/jenkins/workspace/ABC-MASTER/src/abc app AllTests --log-junit
/var/lib/jenkins/workspace/ABC-MASTER/build/logs/junit.xml --coverage-clover
/var/lib/jenkins/workspace/ABC-MASTER/build/logs/clover.xml --coverage-html
/var/lib/jenkins/workspace/ABC-MASTER/build/coverage
This generates coverage reports even for lib folder.
My questions are:
- Should I generate the coverage html pages for lib folder as well?
- If not, how do I turn it off?
My code is structured as:
build
src
abc (this is the app folder)
lib ( this is the Cake lib folder)
tests
Test (this follows the Cake convention)
The solution has 3 parts:
1) create a phpunit.xml.dist inside the project root.
build
src
abc (this is the app folder)
lib ( this is the Cake lib folder)
tests
Test (this follows the Cake convention)
build.xml
phpunit.xml.dist
2) create the following content inside the phpunit.xml.dist
3) add in
--configuration /path/to/phpunit.xml.distto the command.In the example given in the question, this becomes:
For more information on how to use phpunit configuration file, look at this link. It will help to understand how to use the phpunit configuration file in particular the blacklist and whitelist section.