Home » Php » php – Bamboo CI Server – how to configure PHPUnit testing

php – Bamboo CI Server – how to configure PHPUnit testing

Posted by: admin July 12, 2020 Leave a comment


i would like to set up Bamboo CI Server. I’ve created two stages:

  • Stage 1: “Code checkout” with code checkout.
  • Stage 2: “PHPunit” with testing via phpunit.

Stage 1 is OK, but on stage 2 I have an error. In Build Log I have:

Starting task 'PHPUnit Testing' of type 'com.atlassian.bamboo.plugins.php:task.builder.phpunit'
12-paź-2014 10:45:49    
Beginning to execute external process for build 'CCP - CI - Unit Testing Build - Default Job #4 (CCPCI-UTB-JOB1-4)'
... running command line:
/usr/local/bin/phpunit --log-junit test-reports/phpunit.xml --coverage-html test-reports/coverage/html --bootstrap /var/www/html/ccp/core/tests/bootstrap.php --no-configuration /var/www/html/ccp/core/tests
... in: /home/bamboo/bamboo_home/xml-data/build-dir/CCPCI-UTB-JOB1
12-paź-2014 10:45:49    X-Powered-By: PHP/5.5.11
12-paź-2014 10:45:49    Content-type: text/html
12-paź-2014 10:45:49    
12-paź-2014 10:45:49    Failing task since text 'OK' was not found in last 250 log entries
12-paź-2014 10:45:49    Parsing test results...
12-paź-2014 10:45:49    Finished task 'PHPUnit Testing' 

If in server terminal I execute phpunit command (/usr/local/bin/phpunit –log-junit test-reports/phpunit.xml –coverage-html test-reports/coverage/html –bootstrap /var/www/html/ccp/core/tests/bootstrap.php –no-configuration /var/www/html/ccp/core/tests), everything is correct (there is OK response).

What’s wrong with this?

On the overview screen of build there are two errors:

  1. (Job results summary) No failed tests found, a possible compilation error occurred.
  2. (Error summary) Could not find test result reports in the /home/bamboo/bamboo_home/xml-data/build-dir/CCPCI-UTB-JOB1 directory.

I would be grateful for any help.

How to&Answers:

Solution as posted by OP in comments:

I have resolved my problem.

I had to add an environment variable to file setenv.sh:


Everything works very well.