【发布时间】:2016-08-10 21:25:08
【问题描述】:
我在使用 Travis CI 和 PHPUnit 时遇到了一点问题——它似乎只执行了一个测试文件——奇怪的是——tests/unit/helpers/XMLFileTest.php。
https://travis-ci.org/Matt-Barber/DataCruncher/jobs/151193473
这是我正在使用的 phpunit.xml.dist 的副本:
<phpunit
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
strict="true"
bootstrap="vendor/autoload.php"
verbose = "true"
>
<testsuites>
<testsuite name="unit">
<directory suffix='.php'>./tests/unit</directory>
</testsuite>
<testsuite name="integration">
<directory suffix='.php'>./tests/integration</directory>
</testsuite>
<testsuite name="functional">
<directory suffix='.php'>./tests/functional</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="build/coverage" title="CSV_Cruncher" charset="UTF-8" yui="true" highlight="true" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
</phpunit>
还有我正在使用的 travis.yml
language: php
php:
- '5.6'
- '7.0'
before_script:
- composer install
- find . -type f -name *.csv -exec chmod 777 {} +
- mkdir build
script:
- phpunit --configuration phpunit.xml.dist --debug
after_script:
- php vendor/bin/coveralls -v
我的 src 的文件夹结构是:
src
- Analysis
- Statistics.php
- Config
- Validation.php
- Exceptions
- [various]
- Helpers
- DataInterface.php
- DataFile.php
- CSVFile.php
- XMLFile.php
- Segmentation
- Merger.php
- Query.php
- Split.php
测试是一样的:
tests
- unit
- Analysis
- StatisticsTest.php
等等……
这里是 git repo 的链接 https://github.com/Matt-Barber/DataCruncher/tree/develop
其他测试没有执行的任何原因?它们在本地和通过带有 XDebug 的流浪机器上运行似乎都很好......它伤害了我的大脑(正如你从提交历史中看到的那样)
任何问题,非常感谢您的帮助!
干杯!
更新
答案是记住
mv Folder folder
和
不一样git mv Folder folder
谢谢你!指出差异!
【问题讨论】:
标签: php testing continuous-integration phpunit travis-ci