contributte/gopay

Travis CI: report to coveralls failed

Closed this issue · 6 comments

f3l1x commented

Copy of that - https://travis-ci.org/Markette/Gopay/jobs/59558874

Load coverage clover log:

  • /home/travis/build/Markette/Gopay/coverage.xml
    Found 17 source files:
  • 0.00% Api/CountryCode.php
  • 20.00% Api/GopayConfig.php
  • 17.55% Api/GopayHelper.php
  • 0.00% Api/GopayHttp.php
  • 0.24% Api/GopaySoap.php
  • 0.00% Api/PaymentMethodElement.php
  • 0.00% Api/PaymentMethods.php
  • 94.12% Extension.php
  • 100.00% GopayException.php
  • 100.00% GopayFatalException.php
  • 100.00% GopayHolder.php
  • 100.00% IPaymentButton.php
  • 100.00% ImagePaymentButton.php
  • 100.00% Payment.php
  • 100.00% PaymentButton.php
  • 100.00% ReturnedPayment.php
  • 81.15% Service.php
    Coverage: 31.54% (299/948)
    Collect git info
    Read environment variables
    Dump uploading json file: /home/travis/build/Markette/Gopay/coverage.json
    PHP Catchable fatal error: Method Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile::__toString() must return a string value in /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php on line 107
    PHP Stack trace:
    PHP 1. {main}() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/composer/bin/coveralls:0
    PHP 2. Symfony\Component\Console\Application->run() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/composer/bin/coveralls:34
    PHP 3. Symfony\Component\Console\Application->doRun() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Application.php:126
    PHP 4. Symfony\Component\Console\Application->doRunCommand() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Application.php:195
    PHP 5. Symfony\Component\Console\Command\Command->run() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Application.php:874
    PHP 6. Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->execute() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
    PHP 7. Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->runApi() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:103
    PHP 8. Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->dumpJsonFile() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:152
    PHP 9. Contrib\Bundle\CoverallsV1Bundle\Api\Jobs->dumpJsonFile() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:263
    PHP 10. file_put_contents() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php:107
    Catchable fatal error: Method Contrib\Bundle\CoverallsV1Bundle\Entity\JsonFile::__toString() must return a string value in /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php on line 107
    Call Stack:
    0.0002 241440 1. {main}() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/composer/bin/coveralls:0
    0.0187 2049568 2. Symfony\Component\Console\Application->run() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/composer/bin/coveralls:34
    0.0232 2451032 3. Symfony\Component\Console\Application->doRun() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Application.php:126
    0.0234 2451928 4. Symfony\Component\Console\Application->doRunCommand() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Application.php:195
    0.0234 2452352 5. Symfony\Component\Console\Command\Command->run() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Application.php:874
    0.0238 2455600 6. Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->execute() /home/travis/build/Markette/Gopay/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
    0.0378 3695016 7. Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->runApi() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:103
    0.0935 5127664 8. Contrib\Bundle\CoverallsV1Bundle\Command\CoverallsV1JobsCommand->dumpJsonFile() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:152
    0.0936 5127768 9. Contrib\Bundle\CoverallsV1Bundle\Api\Jobs->dumpJsonFile() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Command/CoverallsV1JobsCommand.php:263
    0.0936 5127816 10. file_put_contents() /home/travis/build/Markette/Gopay/vendor/satooshi/php-coveralls/src/Contrib/Bundle/CoverallsV1Bundle/Api/Jobs.php:107
    Done. Your build exited with 0.
f3l1x commented

@haltuf @hranicka Do you know where problem is?

The problems started with build No.4, which is strange - I don't see many relevant changes: ec961e8...71dc007

I'm examining more the differences in log files between Build 3 (when it worked) and Build 4 (when it stopped working). I found another difference, in failed build, there are following messages in the part, when satooshi/php-coveralls are installed:

Downloading: connection... Failed to download psr/log from dist: Could not authenticate against github.com Now trying to download from source

This might be solved (probably?) using this: http://help.pagodabox.com/customer/portal/questions/6193893-failed-to-download-doctrine-common-from-dist-could-not-authenticate-against-github-com/
(last post)

But it could be the cause of the problems only in the case, if dist differs from source (I'm new in this stuff, don't know if it's possible at all)

Please also note, that in your Pull request #31, you should change the .coveralls.yml file (src_dir) to reflect the new directory structure.

@f3l1x Ok, all my hypotheses proved to be nonsense. The satooshi/php-coveralls used for code coverage report generating and sending stopped working in PHP 5.5 & 5.6 for no obvious reason (I can't debug it directly in Travis, probably even impossible, and don't have 5.5+ on my localhost).
It works in 5.4, though.
I guess after some change, coverage.xml generated by Nette\Tester contains something, that satooshi simply cannot handle and fails. It's still strange, though, since most people I saw, use coveralls on PHP5.6 without problems...

@f3l1x Allright, I digged even deeper and found the real cause of the problem: GopayHolder.php is not in UTF-8. This is the reason why JsonFile::__toString() returns FALSE instead of string in PHP5.5+ (json_encode returns error code 5 with message "Malformed UTF-8 characters, possibly incorrectly encoded")
After fixing the encoding of the file, my PR #33 is not neccessary any more.

f3l1x commented

Oh, thanks for that. PhpStorm probably changed my encoding. Great!