Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scrutinizer says it was notified by Travis that the "tests failed", but the tests did pass

I have this project on GitHub. In my .travis.yml file, I use the same configuration I use on every project, to upload the code coverage data to Scrutinizer:

after_script:
  - wget https://scrutinizer-ci.com/ocular.phar
  - php ocular.phar code-coverage:upload --format=php-clover test/build/logs/clover.xml

Here's the most recent successful build on Travis:

https://travis-ci.org/mindplay-dk/boxy/builds/61963347

And here's the most recent failed inspection on Scrutinizer:

https://scrutinizer-ci.com/g/mindplay-dk/boxy/inspections/ac33c2fb-6083-4984-bf41-983e4d0f54e2

The error message "Scrutinizer was notified that the tests failed", appears to show up as soon as Travis uploads the code coverage data.

like image 325
mindplay.dk Avatar asked May 14 '15 09:05

mindplay.dk


1 Answers

If you check the individual build jobs, there should be one where the upload command outputs something like "Notifying that no code coverage is available".

This is typically happening for the HHVM build, or a PHP 7 build which both do not support running code coverage.

To fix this, make sure that you do not run the upload command for these versions:

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
like image 152
secondtruth Avatar answered Oct 12 '22 07:10

secondtruth