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

Better control about how Code Coverage is calculated #185

Closed
c33s opened this issue Aug 18, 2016 · 2 comments
Closed

Better control about how Code Coverage is calculated #185

c33s opened this issue Aug 18, 2016 · 2 comments
Milestone

Comments

@c33s
Copy link

c33s commented Aug 18, 2016

currently humbug automatically calls phpunit (phpunit is located with the executeable finder). this has some serious drawbacks.

  • humbug requires phpunit for codecoverage calculation
  • phpunit requires xdebug for codecoverage calculation
  • xdebug has a serious speed impact on many other tools

in my setup, xdebug is disabled on the cli per default. so programs like composer or php-cs-fixer don't have performance issues.

php-cs-fixer & xdebug

You are running php-cs-fixer with xdebug enabled. This has a major impact on runtime performance

composer.phar & xdebug

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug

one solution to run only a specific command with xdebug is to call it like that:

php -d zend_extension=xdebug.so phpunit.phar
php -d zend_extension=xdebug.so humbug.phar

but as humbug calls phpunit by itself, the information about the extension loading is not piped to phpunit. so i get the following error:

Tests must be in a fully passing state before Humbug is run.
Incomplete, skipped or risky tests are allowed.
The testing framework reported an exit code of 1.
The testing framework ran into a failure or error. Refer to output below.
Stderr:

You need to install and enable xdebug in order to allow for code coverage generation.

of course i can do some workarounds, to control that humbug first finds a special phpunit version, but i think humbug should let me configure the exact phpunit command via config file and also dynamic via command line.

also it should be able to use phpdbg to get the code coverage

phpdbg -qrr phpunit.phar --debug --coverage-text
...
Code Coverage Report:
  2016-08-19 01:46:19
...

humbug don't work with phpdbg:

phpdbg -qrr humbug.phar
Warning: Humbug may only be invoked from a command line
You need to install and enable xdebug in order to allow for code coverage generation.

related issues:

what i would be happy to see in this project:

  • configure how phpunit is called and where it is located via config and arguments
  • support for phpdbg
@theofidry
Copy link
Member

Out of curiosity why do you need to generate code coverage with humbug?

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

padraic commented May 13, 2017

Closing as tracking these via #249 and #253.

@padraic padraic closed this as completed May 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants