PHPUnit이 로컬 컴퓨터에서 제대로 작동하면 Travis-CI에서 작동하도록하는 데 문제가 있습니다. 동일한 PHP 버전과 PHPUnit 버전을 사용하고 있습니다.Travis-CI에서 PHPUnit이 실패하지만 로컬로 전달됩니다
내 코드베이스 출력이 저장소의 루트에서 phpunit -c build/phpunit.xml
을 실행 https://travis-ci.org/lncd/OAuth2
에있다 https://github.com/lncd/OAuth2
트래비스-CI에서 것은 지역적으로 잘 작동하고 예상대로 테스트를 실행합니다.
트래비스의 로그는 다음과 같습니다
$ cd ~/builds
$ git clone --branch=develop --depth=100 --quiet git://github.com/lncd/OAuth2.git lncd/OAuth2
$ cd lncd/OAuth2
$ git checkout -qf 1c3b319aa6c8f5521d5123f0e6affca94ee35010
$ phpenv global 5.3
$ php --version
PHP 5.3.19 (cli) (built: Dec 20 2012 09:57:38)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
$ phpunit -c build/phpunit.xml
PHP Warning: require_once(src/OAuth2/Authentication/Server.php): failed to open stream: No such file or directory in /home/travis/builds/lncd/OAuth2/tests/authentication/server_test.php on line 3
PHP Stack trace:
PHP 1. {main}() /home/travis/.phpenv/versions/5.3.19/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /home/travis/.phpenv/versions/5.3.19/bin/phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/TextUI/Command.php:129
PHP 4. PHPUnit_TextUI_Command->handleArguments() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/TextUI/Command.php:138
PHP 5. PHPUnit_Util_Configuration->getTestSuiteConfiguration() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/TextUI/Command.php:657
PHP 6. PHPUnit_Util_Configuration->getTestSuite() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/Util/Configuration.php:784
PHP 7. PHPUnit_Framework_TestSuite->addTestFiles() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/Util/Configuration.php:860
PHP 8. PHPUnit_Framework_TestSuite->addTestFile() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/Framework/TestSuite.php:416
PHP 9. PHPUnit_Util_Fileloader::checkAndLoad() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/Framework/TestSuite.php:355
PHP 10. PHPUnit_Util_Fileloader::load() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/Util/Fileloader.php:76
PHP 11. include_once() /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php/PHPUnit/Util/Fileloader.php:92
내가 require_once '../../src/OAuth2/Authentication/Server.php';
(아래 실행 파일 즉, 두 개의 디렉토리를)로드 require_once
을 변경하여 주위를 해본 적이 있지만 트래비스 또는 내 로컬에서 작동하지 않습니다 설정.
내가 뭘 잘못하고 있니? 아니면 트래비스와 관련된 버그입니까?
감사합니다
편집:
이 디렉토리 구조입니다 명확히하려면 :
build
/phpunit.xml
src
/OAuth2
/Authentication
/Database.php
/Server.php
/Resource
/Database.php
/Server.php
tests
/authentication
/database_mock.php
/server_test.php
/resource
/database_mock.php
/server_test.php
두 파일에서/테스트 디렉토리 아래에 server_test.php
라고는 각각의로드하려고 Server.php
및 Database.php
/src 아래의 디렉토리에있는 파일
'위해서 var_dump (에 getcwd(), get_include_path());' – zerkms
'getcwd' :./홈/트래비스/구축/lncd/OAuth2를 'path'을 포함한다 :/홈/트래비스/.phpenv/버전/5.3.19/pear : /home/travis/.phpenv/versions/5.3.19/share/pyrus/.pear/php '__FILE__' :/home/travis/builds/lncd/OAuth2/tests/authentication/server_test .php '__DIR__' :/home/travis/builds/lncd/OAuth2/tests/authentication – alexbilbie
모든 요구 사항을 설치하지 않은 것 같습니다. –