Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to run unit tests #8

Open
miogalang opened this issue Oct 2, 2014 · 5 comments
Open

Failing to run unit tests #8

miogalang opened this issue Oct 2, 2014 · 5 comments

Comments

@miogalang
Copy link

I tried using ansible to make this work. Had a few edits but I finally got it running. I now run into this error as it tries to build the sample project.

Any Ideas?

phpunit:
    [exec] PHP Warning:  require_once(PHPUnit/Runner/Version.php): failed to open stream: No such file or directory in /var/www/yii-1.1.14.f0fee9/framework/test/CTestCase.php on line 11
    [exec] PHP Stack trace:
    [exec] PHP   1. {main}() /usr/bin/phpunit:0
    [exec] PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:583
    [exec] PHP   3. PHPUnit_TextUI_Command->run() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:132
    [exec] PHP   4. PHPUnit_Runner_BaseTestRunner->getTest() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:153
    [exec] PHP   5. PHPUnit_Framework_TestSuite->addTestFiles() phar:///usr/bin/phpunit/phpunit/Runner/BaseTestRunner.php:97
    [exec] PHP   6. PHPUnit_Framework_TestSuite->addTestFile() phar:///usr/bin/phpunit/phpunit/Framework/TestSuite.php:411
    [exec] PHP   7. PHPUnit_Util_Fileloader::checkAndLoad() phar:///usr/bin/phpunit/phpunit/Framework/TestSuite.php:358
    [exec] PHP   8. PHPUnit_Util_Fileloader::load() phar:///usr/bin/phpunit/phpunit/Util/Fileloader.php:77
    [exec] PHP   9. include_once() phar:///usr/bin/phpunit/phpunit/Util/Fileloader.php:93
    [exec] PHP  10. YiiBase::autoload() /var/www/yii-1.1.14.f0fee9/framework/YiiBase.php:0
    [exec] PHP  11. include() /var/www/yii-1.1.14.f0fee9/framework/YiiBase.php:401
    [exec] PHP Fatal error:  require_once(): Failed opening required 'PHPUnit/Runner/Version.php' (include_path='.:/var/lib/jenkins/jobs/yii-sample-project/workspace/src/protected/components:/var/lib/jenkins/jobs/yii-sample-project/workspace/src/protected/models:/usr/share/php:/usr/share/pear') in /var/www/yii-1.1.14.f0fee9/framework/test/CTestCase.php on line 11
    [exec] PHP Stack trace:
    [exec] PHP   1. {main}() /usr/bin/phpunit:0
    [exec] PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:583
    [exec] PHP   3. PHPUnit_TextUI_Command->run() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:132
    [exec] PHP   4. PHPUnit_Runner_BaseTestRunner->getTest() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:153
    [exec] PHP   5. PHPUnit_Framework_TestSuite->addTestFiles() phar:///usr/bin/phpunit/phpunit/Runner/BaseTestRunner.php:97
    [exec] PHP   6. PHPUnit_Framework_TestSuite->addTestFile() phar:///usr/bin/phpunit/phpunit/Framework/TestSuite.php:411
    [exec] PHP   7. PHPUnit_Util_Fileloader::checkAndLoad() phar:///usr/bin/phpunit/phpunit/Framework/TestSuite.php:358
    [exec] PHP   8. PHPUnit_Util_Fileloader::load() phar:///usr/bin/phpunit/phpunit/Util/Fileloader.php:77
    [exec] PHP   9. include_once() phar:///usr/bin/phpunit/phpunit/Util/Fileloader.php:93
    [exec] PHP  10. YiiBase::autoload() /var/www/yii-1.1.14.f0fee9/framework/YiiBase.php:0
    [exec] PHP  11. include() /var/www/yii-1.1.14.f0fee9/framework/YiiBase.php:401
@yauh
Copy link
Owner

yauh commented Oct 2, 2014

Off the top of my hat - the Yii framework is available in the /var/www folder?
No such file or directory in /var/www/yii-1.1.14.f0fee9/framework/test/CTestCase.php

@miogalang
Copy link
Author

Yes it is available.

    mio@jenkins:/var/www$ ls -lta
    total 20
    drwxr-xr-x  4 root root  4096 Oct  2 13:10 .
    drwxr-xr-x 13 root root  4096 Oct  1 19:01 ..
    lrwxrwxrwx  1 root root    26 Oct  1 18:05 yii -> /var/www/yii-1.1.14.f0fee9
    -rw-r--r--  1 root root   177 Oct  1 14:48 index.html
    drwxr-xr-x  5  501 staff 4096 Aug 12  2013 yii-1.1.14.f0fee9

I am trying a few more stuff I found stackoverflow. Including updating Yii, and installing PHPUnit_CodeCoverage. Will come back with results.

@miogalang
Copy link
Author

Ok it seems phpunit does not want itself installed using pear anymore

see:
sebastianbergmann/phpunit#1173

@miogalang
Copy link
Author

@yauh Just an update I was able to make it work by installing the phpunit stuff via composer. I will find some time to clean it up over the weekend and send a pull request if you are interested.

@yauh
Copy link
Owner

yauh commented Oct 10, 2014

Great, love to see your pull request. Thanks for investigating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants