thephpleague / phpunit-coverage-listener

Report code coverage statistics to third-party services
thephpleague.com
MIT License
48 stars 6 forks source link

Getting a "JSON file not found or failed to parse" error. #3

Open frankdejonge opened 10 years ago

frankdejonge commented 10 years ago

So, I'm getting this error and there's no indication of what I can do or change to fix it.

toopay commented 10 years ago

Hey @FrenkyNet Can you provide corresponding phpunit configuration?

frankdejonge commented 10 years ago

Sure, it's this: https://github.com/thephpleague/flysystem/blob/master/phpunit.xml.dist

frankdejonge commented 10 years ago

and hey @toopay :)

frankdejonge commented 10 years ago

@toopay wait, I've messed something up, lemme correct the obvious first. Moment!

frankdejonge commented 10 years ago

@toopay right, so corrected that location, though I still receive an error. This is the CLI output:

Collecting CodeCoverage information...
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/AbstractAdapter.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/AbstractFtpAdapter.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/AwsS3.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/Dropbox.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/Ftp.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/Local.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/Rackspace.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Adapter/Zip.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Cache/AbstractCache.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Cache/Adapter.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Cache/Memcached.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Cache/Memory.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Cache/Noop.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Cache/Predis.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Config.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Directory.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/File.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/FileExistsException.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/FileNotFoundException.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Filesystem.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Handler.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/MountManager.php
 * Checking:/Users/FrenkyNet/Sites/flysystem/src/Util.php
Writing coverage output...
Sending coverage output...
 * cURL Output:{"message":"JSON file not found or failed to parse.","error":true,"url":""}
 * cURL Result:1
toopay commented 10 years ago

chmod 777 /path/to/coverage/dir ?

frankdejonge commented 10 years ago

@toopay it's /tmp/ so that shouldn't be necessary, right?

toopay commented 10 years ago

I can't reproduce it in my local

screenshot from 2014-03-09 16 05 18

I assume this error occurs in your local, yes? Are you in Unix OS?

frankdejonge commented 10 years ago

I'm on OSX (mac), it's local.

toopay commented 10 years ago

Can you see the actual json file within target directory?

frankdejonge commented 10 years ago

Jep, the json is there next to the coverage.xml

frankdejonge commented 10 years ago

Also, the /tmp/flysystem folder has the correct rights.

toopay commented 10 years ago

There are two known related issues at coveralls end :

I will need some time to investigate this, will keep these one open until we know what happens. Thanks for raising this issue.

frankdejonge commented 10 years ago

@toopay thanks for taking the time :+1:

ghost commented 10 years ago

I am also getting the same error in both local and TravisCI for some repos. In most of them it works perfectly, but lately in my 2 newly added repos I get such error message. I even tried changing the Token from Coveralls, still the same.

From TravisCI

Generating code coverage report in Clover XML format ... done
Collecting CodeCoverage information...
 * Checking:/home/travis/build/rajibmp/ImageR/src/images/Circle.php
 * Checking:/home/travis/build/rajibmp/ImageR/src/images/ImageTrait.php
 * Checking:/home/travis/build/rajibmp/ImageR/src/images/Rectangle.php
 * Checking:/home/travis/build/rajibmp/ImageR/src/lib/ClassnameTrait.php
Writing coverage output...
Sending coverage output...
 * cURL Output:{"message":"JSON file not found or failed to parse.","error":true,"url":""}
 * cURL Result:1
Done.
The command "phpunit --coverage-clover /tmp/rajibmp/imager/coverage.xml" exited with 0.
Could not open input file: vendor/bin/coveralls
Done. Your build exited with 0.

In Local Environment

Generating code coverage report in Clover XML format ... done

Collecting CodeCoverage information...
 * Checking:/home/rajib/websites/ImageR/src/images/Circle.php
 * Checking:/home/rajib/websites/ImageR/src/images/ImageTrait.php
 * Checking:/home/rajib/websites/ImageR/src/images/Rectangle.php
 * Checking:/home/rajib/websites/ImageR/src/lib/ClassnameTrait.php
 * Checking:/home/rajib/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php
 * Checking:/home/rajib/.composer/vendor/phpunit/phpunit/src/Util/Configuration.php
 * Checking:/home/rajib/.composer/vendor/phpunit/phpunit/src/Util/Fileloader.php
 * Checking:/home/rajib/.composer/vendor/phpunit/phpunit/src/Util/Getopt.php
 * Checking:/home/rajib/.composer/vendor/phpunit/phpunit/src/Util/XML.php
Writing coverage output...
Sending coverage output...
 * cURL Output:{"message":"JSON file not found or failed to parse.","error":true,"url":""}
 * cURL Result:1
Done.
ghost commented 10 years ago

Just found out this Coverage Listener doesn't work with PHP 5.5+

I switched back to PHP 5.4 via VirtPHP and I don't get this cURL output error.

And Millions of Warnings in HHVM about passed array, anyways I have stated that #4 too...