我一直在關注第一次PHPUnit教程,我的測試在本地運行良好。但是,當在Travis CI上運行我的測試時,沒有執行測試,我的構建以0退出。PHPunit沒有在Travis CI上執行測試
我的目錄結構和完整代碼可以在repo上看到。
生成日誌特拉維斯CI (Full build log)
1.51s$ curl -s http://getcomposer.org/installer | php
#!/usr/bin/env php
All settings correct for using Composer
Downloading...
Composer successfully installed to: /home/travis/build/idavidmcdonald/phpunit-tutorial/composer.phar
Use it: php composer.phar
before_script.2
0.33s$ php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
0.08s$ vendor/bin/phpunit --debug
PHPUnit 3.7.14 by Sebastian Bergmann.
Configuration read from /home/travis/build/idavidmcdonald/phpunit-tutorial/phpunit.xml
Time: 13 ms, Memory: 2.00Mb
No tests executed!
The command "vendor/bin/phpunit --debug" exited with 0.
Done. Your build exited with 0.
phpunit.xml:
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Application Test Suite">
<directory>phpunittutorial/tests/</directory>
</testsuite>
</testsuites>
</phpunit>
.travis.yml:
language: php
php:
- 5.4
- 5.5
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar install
script: vendor/bin/phpunit --debug
我的測試中成功運行在本地,但也許有我的phpunit.xml文件存在問題?
一些評論認爲可以改善這種情況:1,作曲家已經安裝在特拉維斯,沒有必要再完全安裝。您可能想運行'composer self-update'而不是運行curl install命令。 2.隨後,Composer直接被稱爲'composer',而不是'php composer.phar'。 3.爲了調試可能的作曲家問題,運行帶有'-vvv'等冗長標誌的安裝命令。 – Sven