matthiasnoback / behat-local-code-coverage-extension Goto Github PK
View Code? Open in Web Editor NEWBehat extension for generating (local) code coverage data.
License: MIT License
Behat extension for generating (local) code coverage data.
License: MIT License
I'm getting empty results when I use phpcov on the output from this extension:
Code Coverage Report:
2018-07-17 01:57:32
Summary:
Classes: (0/0)
Methods: (0/0)
Lines: (0/0)
The .cov file is 118K and starts like:
<?php return unserialize('O:43:"SebastianBergmann\\CodeCoverage\\CodeCoverage":20:{s:51:"' . "\0" . 'SebastianBergmann\\CodeCoverage\\CodeCoverage' . "\0" . 'driver";O:44:"SebastianBergmann\\CodeCoverage\\Driver\\Xdebug":1:{s:59:"' . "\0" .
So it seems to be the right thing. But I notice when it gets included in SebastianBergmann\PHPCOV\MergeCommand
, the resulting object doesn't have anything in the data
array.
When PHPUnit runs and fails to find a code coverage driver (xdebug) it tells you and continues with the tests anyway. I just doesn't generate the coverage reports. This is pretty good as it simplifies our phpunit config and means we can choose to run with or without coverage by simply not enabling xdebug on that container run.
But this extension fails hard if a coverage driver cannot be found. Ideally it would provide for the same behaviour as PHPUnit.
PHPunit, on a test suite that provides 100% coverage of a class gives me
Behat coverage, with a suite which I think gives 100% coverage gives me
or (different method but similar code)
The switch case lines are always ignored by phpunit, but intermittently covered by behat-local-code-coverage. I've had a rummage through both PHPunit and this extensions implementation of the CodeCoverage library and they both call in very similar ways. So I have no realy idea why they're behaving differently.
The only difference in the coverage files that I can see is that a PHPUnit file does not have any $ignoredLines when debugging. This extension produces files with $ignoredLines populated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.