min*_*.dk 7 continuous-integration unit-testing github travis-ci scrutinizer
我在GitHub上有这个项目.在我的.travis.yml文件中,我使用与每个项目相同的配置,将代码覆盖率数据上传到Scrutinizer:
after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover test/build/logs/clover.xml
Run Code Online (Sandbox Code Playgroud)
这是Travis最近的成功构建:
https://travis-ci.org/mindplay-dk/boxy/builds/61963347
这是最近对Scrutinizer进行的失败检查:
https://scrutinizer-ci.com/g/mindplay-dk/boxy/inspections/ac33c2fb-6083-4984-bf41-983e4d0f54e2
一旦Travis上传代码覆盖率数据,就会显示错误消息"Scrutinizer被通知测试失败".
如果您检查单个构建作业,则应该有一个上载命令输出类似"通知没有代码覆盖可用"的内容.
这通常发生在HHVM构建或PHP 7构建中,它们都不支持运行代码覆盖.
要解决此问题,请确保不对这些版本运行upload命令:
after_script:
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
Run Code Online (Sandbox Code Playgroud)