Travis CI 工作正常,但 Coveralls 看不到构建
Travis CI works correctly, but Coveralls doesn't see the builds
我在 Github 上有一个存储库,一个带有 PHP 单元测试套件 (https://github.com/antodippo/ccmusicsearch), and Travis CI is correctly checking the build every time I push (https://travis-ci.org/antodippo/ccmusicsearch/builds) 的 PHP Symfony 应用程序。
我将 Coveralls 帐户链接到我的 Travis 和 Github 帐户,并以这种方式配置了我的 .travis.yml 文件:
language: php
php:
- 5.5
- 5.6
before_script:
- composer self-update
- composer install
script:
- mkdir -p build/logs
- phpunit -c app/phpunit.xml.dist
after_success:
- bin/coveralls -v
我把这行放在我的 phpunit.xml.dist:
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
但 Coveralls 仍然说没有构建 (https://coveralls.io/github/antodippo)。
我忘记了什么?
抱歉,没有足够的声誉来发表评论。
我有同样的问题。在 travis ci 上我得到了文件的覆盖百分比,但在 coveralls.io 上什么都没有
我注意到工作服上写着
We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.
我有同样的消息,我添加了徽章。似乎无法同步
编辑:
这里是我修复
的方法
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] coverage_clover XML file is not readable
并使工作服发挥作用
-.travis yml
脚本:
script:
- phpunit -c app/ src/ --coverage-clover build/logs/clover.xml
after_success:
- bin/coveralls -v
-phpunit.xml.dist
:
....
<logging>
<log type="coverage-html" target="build/coverage" title="coverage" charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
...
-在我的 SF 项目的根目录下创建了一个 .coveralls.yml
文件:
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
exclude_no_stmt: true
确保您的 bin/coveralls
文件夹位于 SF 项目的根目录下
问题是 phpunit.xml.dist 配置 clover.xml 文件是在 /app/builds/logs/clover.xml 中创建的。所以我以这种方式更改了 .travis.yml 中的 phpunit 脚本:
phpunit --coverage-clover build/logs/clover.xml -c app
因此文件在 /app/builds/logs/clover.xml 中正确生成,工作服现在工作正常。
我在 Github 上有一个存储库,一个带有 PHP 单元测试套件 (https://github.com/antodippo/ccmusicsearch), and Travis CI is correctly checking the build every time I push (https://travis-ci.org/antodippo/ccmusicsearch/builds) 的 PHP Symfony 应用程序。
我将 Coveralls 帐户链接到我的 Travis 和 Github 帐户,并以这种方式配置了我的 .travis.yml 文件:
language: php
php:
- 5.5
- 5.6
before_script:
- composer self-update
- composer install
script:
- mkdir -p build/logs
- phpunit -c app/phpunit.xml.dist
after_success:
- bin/coveralls -v
我把这行放在我的 phpunit.xml.dist:
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
但 Coveralls 仍然说没有构建 (https://coveralls.io/github/antodippo)。
我忘记了什么?
抱歉,没有足够的声誉来发表评论。 我有同样的问题。在 travis ci 上我得到了文件的覆盖百分比,但在 coveralls.io 上什么都没有 我注意到工作服上写着
We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.
我有同样的消息,我添加了徽章。似乎无法同步
编辑:
这里是我修复
的方法[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] coverage_clover XML file is not readable
并使工作服发挥作用
-.travis yml
脚本:
script:
- phpunit -c app/ src/ --coverage-clover build/logs/clover.xml
after_success:
- bin/coveralls -v
-phpunit.xml.dist
:
....
<logging>
<log type="coverage-html" target="build/coverage" title="coverage" charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
...
-在我的 SF 项目的根目录下创建了一个 .coveralls.yml
文件:
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
exclude_no_stmt: true
确保您的 bin/coveralls
文件夹位于 SF 项目的根目录下
问题是 phpunit.xml.dist 配置 clover.xml 文件是在 /app/builds/logs/clover.xml 中创建的。所以我以这种方式更改了 .travis.yml 中的 phpunit 脚本:
phpunit --coverage-clover build/logs/clover.xml -c app
因此文件在 /app/builds/logs/clover.xml 中正确生成,工作服现在工作正常。