Comments (17)
You seem to have a non-standard directory setup ...
php -dpcov.directory=. -dpcov.exclude="~vendor~" vendor/bin/phpunit tests
That's likely what you are looking for ...
from pcov.
What do you mean by "non-standard"? The src-dev
directory? I have removed it and all references to it and still facing the issue. It was all fine a month ago -> https://coveralls.io/builds/23169688 (AFAIR it was PCOV v1.0.2 then).
However, your suggestion fixes it, thanks π
from pcov.
from pcov.
Doesn't seems so - there are tests that covers lines that are problematic right now - e.g. https://github.com/kubawerlos/php-cs-fixer-custom-fixers/blob/master/tests/Fixer/InternalClassCasingFixerTest.php#L19 - and as I mentioned, when running only tests from subdirectory tests/Fixer
all is covered fine.
from pcov.
You're quite right, something doesn't look right ... (I'm at my keyboard properly now, looking) ...
from pcov.
Can you please try the tip of develop (currently 1.1.0-dev) and patch vendor/phpunit/php-code-coverage/src/Driver/PCOV.php with this stop method:
/**
* Stop collection of code coverage information.
*/
public function stop(): array
{
\pcov\stop();
$waiting = \pcov\waiting();
$collect = [];
if ($waiting) {
$collect = \pcov\collect(\pcov\inclusive, $waiting);
if ($collect) {
\pcov\clear(\pcov\coverage | \pcov\waiting);
} else {
\pcov\clear(\pcov\waiting);
}
}
return $collect;
}
I believe this produces correct results ?
from pcov.
Yes, it looks so, thanks for a help!
PR: https://github.com/kubawerlos/php-cs-fixer-custom-fixers/pull/98/files
Build: https://travis-ci.org/kubawerlos/php-cs-fixer-custom-fixers/jobs/540456641
from pcov.
I managed to go one better, you no longer need to patch the PHP driver, just update pcov ... 1.0.4-dev (managed to not break compat, so don't need to bump to 1.1) ...
from pcov.
Sorry about all the mess ...
from pcov.
Sorry about all the mess ...
No need to, thanks for the very quick fix π
from pcov.
Very welcome.
from pcov.
@krakjoe Can you get folders to coverage from the phpunit.xml
?
from pcov.
I think something is still off here, and possibly related to #31 and #38 (my experience lines up with all of these issues). I have a <filter><whitelist>
defined in phpunit.xml
with some <directory>
nodes and an <exclude>
node, and those get processed and sent to the pcov driver by phpunit via sebastianbergmann/php-code-coverage. After executing a simple test (using either phpunit
or paratest
), the resulting test reports show everything as uncovered (including specific lines I know were executed).
If I phpdismod pcov && phpenmod xdebug
, my simple test works exactly as expected. Surely php-code-coverage is sending the filter/whitelist to pcov properly, since I can see the source files/methods/lines listed in the coverage report output -- but they're all marked 0%.
from pcov.
To clarify, php-code-coverage doesn't "send" or pass anything from phpunit configuration to pcov. pcov must be configured properly with pcov.directory.
from pcov.
from pcov.
@BHSPitMonkey I agree with you, I expend two days testing pcov
with no coverage results due to this issue... I finally found the description here and figured it out to use -dpcov.directory
.
from pcov.
Is it possible to run coverage on two folders? I basically have two /app
folders -- one is legacy, and one is modern -- and it looks like the only alternative I have is to set directory to .
and then exclude everything except those two folders. Is that really what I'd have to do?
EDIT: It looks like this works fine after just setting it to .
. From there, it appears that the section of the phpunit.xml config is handling the rest of what I need.
from pcov.
Related Issues (20)
- deleted. HOT 1
- Warning: JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled. in Unknown on line 0
- Add PCOV_ENABLED env var as enable/disable switch HOT 1
- what HOT 1
- Pcov crashes with PHP 8.2
- PCOV causes segmentation fault during memory overflow. HOT 1
- Thanks! Improvement of 50% of my phpunit stage
- Segmentation fault at the end of Phpunit job
- Compile error with PHP 8.1: use option -std=c99 or -std=gnu99 to compile your code
- ignore
- PHP 8.2 support HOT 13
- Alpine binaries? HOT 4
- Feature request: add compatibility with fibers/coroutines
- Coverage information (wrongly?) affected by opcache HOT 3
- Wrong coverage
- Incompatibility with phpdbg
- Can't build on Windows HOT 4
- Tracking coverage of attributes
- Ability to Include Files Outside Project Root or in Vendor Directory for Code Coverage HOT 1
- Coverage merge not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pcov.