Bamboo CI Server - 如何配置PHPUnit测试

Prz*_*jac 8 php continuous-integration phpunit bamboo

我想设置Bamboo CI Server.我创建了两个阶段:

  • 第1阶段:代码签出的"代码签出".
  • 第2阶段:通过phpunit进行测试的"PHPunit".

第1阶段没问题,但在第2阶段我有错误.在构建日志中我有:

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' 
Run Code Online (Sandbox Code Playgroud)

如果在服务器终端我执行phpunit命令(/ 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),一切正常(有好的回复).

这有什么问题?

在构建的概述屏幕上有两个错误:

  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.

我将不胜感激任何帮助.

Pau*_*wen 0

OP在评论中发布的解决方案:

\n
\n

我已经解决了我的问题。

\n

我必须向文件添加一个环境变量setenv.sh

\n
JVM_SUPPORT_RECOMMENDED_ARGS="-Datlassian.bamboo.builder.su\xe2\x80\x8c\xe2\x80\x8bccessMarker='OK'"\n
Run Code Online (Sandbox Code Playgroud)\n

一切都运转良好。

\n
\n