Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Missing coverage file in blank project #159

Open
rbairwell opened this issue Nov 23, 2015 · 10 comments
Open

Missing coverage file in blank project #159

rbairwell opened this issue Nov 23, 2015 · 10 comments

Comments

@rbairwell
Copy link

I've just downloaded Humbug (via Composer global) and am running it on the rasmus PHP7 dev box. I've done a basic configuration and when I try to run Humbug it looks for /tmp/humbug/coverage.humbug.php which doesn't (yet) exist (as this is the first time I've used humbug).

Details:

Humbug version 1.0-dev

Humbug running test suite to generate logs and code coverage data...

    0 [>---------------------------------------------------------]  1 sec


  [Humbug\Exception\InvalidArgumentException]
  File does not exist: /tmp/humbug/coverage.humbug.php



Exception trace:
 () at /home/vagrant/.composer/vendor/humbug/humbug/src/Utility/CoverageData.php:35
 Humbug\Utility\CoverageData->__construct() at /home/vagrant/.composer/vendor/humbug/humbug/src/Adapter/Phpunit.php:139
 Humbug\Adapter\Phpunit->getCoverageData() at /home/vagrant/.composer/vendor/humbug/humbug/src/TestSuite/Unit/Runner.php:82
 Humbug\TestSuite\Unit\Runner->run() at /home/vagrant/.composer/vendor/humbug/humbug/src/Command/Humbug.php:112
 Humbug\Command\Humbug->execute() at /home/vagrant/.composer/vendor/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /home/vagrant/.composer/vendor/symfony/console/Application.php:846
 Symfony\Component\Console\Application->doRunCommand() at /home/vagrant/.composer/vendor/symfony/console/Application.php:189
 Symfony\Component\Console\Application->doRun() at /home/vagrant/.composer/vendor/symfony/console/Application.php:120
 Symfony\Component\Console\Application->run() at /home/vagrant/.composer/vendor/humbug/humbug/bin/humbug:70
@ruudk
Copy link

ruudk commented Dec 12, 2015

I have the same on PHP 7

@padraic padraic added the bug label Jan 7, 2016
@hskrasek
Copy link

Getting this on PHP 5.6.16 during first run.

@MarkRedeman
Copy link
Contributor

Can you try adding humbug to your local composer file and check if that works?
I noticed that when I use the globally installed version of humbug I sometimes get errors which seem completely unrelated to versioning.

@hskrasek
Copy link

Tried doing this, but since the codebase I'm working on is still Laravel 4.2, getting dependency conflicts. Will have to try this on a newer codebase

@vigee
Copy link

vigee commented Feb 25, 2016

Same here. php 5.6.18 (on windows).
humbug run from vendor folder not installed localy.

@mnabialek
Copy link

Same here, php 7.0.8, installed globally, cannot install locally because of symfony/console 2.6

@chrisarmitage
Copy link

Same problem, Centos 5.6, PHP 5.6, PHPUnit 4.8.27, Laravel 5.2 project

I did some poking and I think I've found a workaround. Once you get the File does not exist: /tmp/humbug/coverage.humbug.php error, run phpunit --configuration=/tmp/humbug/phpunit.humbug.xml --stop-on-failure --tap manually. This creates the files needed, and all subsequent humbug runs work as expected.

The actual bug appears to be related to the execution of vendor/bin/phpunit. The command it tries to run is /usr/bin/php /var/www/vhosts/{project}/vendor/bin/phpunit --configuration=/tmp/humbug/phpunit.humbug.xml --stop-on-failure --tap, but the phpunit file isn't a PHP file, it's a BASH script.

@theofidry theofidry added this to the 1.0.0 milestone Apr 19, 2017
@padraic
Copy link
Collaborator

padraic commented May 5, 2017

The problem occurs here I think: https://github.com/humbug/humbug/blob/master/src/Adapter/Phpunit/Process/PhpunitExecutableFinder.php#L105

While it seems to cause no issues on Ubuntu here (or on Travis obviously), this function and line is prefixing the phpunit script with php or exec php as standard. Shouldn't be needed.

@voku
Copy link

voku commented Jul 29, 2017

I see this error, with "Windows 10" + "git bash" + "PHP 7.0.21" (with Xdebug v2.5.5)

Humbug running test suite to generate logs and code coverage data...

0 [>---------------------------------------------------------] < 1 sec

[Humbug\Exception\InvalidArgumentException]
File does not exist: C:\Users\User\AppData\Local\Temp/humbug/coverage.humbug.php

solution: uninstall old PHPUnit

mv C:\xampp\php\pear\PHPUnit C:\xampp\php\pear_old\PHPUnit
mv C:\xampp\php\pear\PHPUnit2 C:\xampp\php\pear_old\PHPUnit2
mv C:\xampp\php\pear\PHPUnit.php C:\xampp\php\pear_old\PHPUnit.php

vendor/composer/bin/phpunit --configuration=/tmp/humbug/phpunit.humbug.xml --stop-on-failure --tap

vendor/composer/bin/humbug

Humbug running test suite to generate logs and code coverage data...

0 [>---------------------------------------------------------] < 1 sec

Humbug has completed the initial test run successfully.

@theofidry
Copy link
Member

Indeed this can be due to a lot of things, checking which PHPUnit is used with which config is a good lead. Making it easier to debug would be a nice to have in future versions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants