Skip to content

Conversation

@trejjam
Copy link
Contributor

@trejjam trejjam commented Feb 2, 2019

  • new feature
  • BC break? no

Hello,

I met an announcement about PHPUnit 8 support PCOV which should be really fast in comparison to other code coverage possibilities, e.g. https://twitter.com/kornrunner/status/1091381371447230464, https://twitter.com/RemiCollet/status/1091336903423594496, etc.

This PR adds support for it.

@milo
Copy link
Member

milo commented Feb 8, 2019

@trejjam Great PR! But I have to check, why I get 0% coverage with it :)

@dg
Copy link
Member

dg commented Feb 8, 2019

You should write more tests :)

@trejjam
Copy link
Contributor Author

trejjam commented Feb 8, 2019

To make it work, I needed to configure application path in pcov.directory for my environment (probably because my test entrypoint is in different file subtree then application - which is out of scope in default/auto configuration)

@milo
Copy link
Member

milo commented Feb 19, 2019

The pcov.directory should be set to a common path of all --coverage-src values.

The pcov.directory is SYSTEM,PERDIR so must be set by -d pcov.directory=... from CliTester. Any idea how to do it nice and clean?

  1. Add PhpInterpreter::detectCodeCoverageEngine(): ?string and deprecate PhpInterpreter::canMeasureCodeCoverage()

  2. ?

@milo
Copy link
Member

milo commented Feb 19, 2019

With #400 there is easy to detect PCOV and set -d pcov.directory INI value.

@milo
Copy link
Member

milo commented Feb 19, 2019

Btw. if theoretically, all code coverage engines (PHPDBG, PCOV, Xdebug) are present, which one would you prefer?

Compare https://milovo.cz/static/tester-396/

@trejjam
Copy link
Contributor Author

trejjam commented Feb 20, 2019

I see more points of view:

  • prefer Xdebug - it can cover more edge cases - like method signature, and close brace (I feel it like more robust solution)
  • prefer PCOV - it is fast, lightweight, not requires Xdebug (for PHP 7.3 is still not stable)

I will prefer a fixed order of engines. For me is not important coverage value itself but changes of coverage through time. Using the same engine every time is good enough for me.

@milo milo force-pushed the master branch 2 times, most recently from eaaeb7b to 7184606 Compare February 21, 2019 06:47
@dg dg force-pushed the master branch 2 times, most recently from ee525b7 to 6ca248e Compare February 27, 2019 13:34
milo pushed a commit that referenced this pull request Mar 9, 2019
@milo
Copy link
Member

milo commented Mar 9, 2019

Merged, thank you!

The reasons for preferred code coverage engines are:

  1. PCOV - it is specialized extension for this purpose
  2. PHPDBG - when someone runs Tester with PHPDBG, I assume that a main purpose is code coverage
  3. Xdebug

@milo milo closed this Mar 9, 2019
milo pushed a commit that referenced this pull request Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants