Coder Social home page Coder Social logo

behat-local-code-coverage-extension's People

Contributors

cooperaj avatar exussum12 avatar fryght avatar magikid avatar matthiasnoback avatar rmatil avatar webdevel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

behat-local-code-coverage-extension's Issues

.cov file doesn't seem to be compatible with phpcov

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.

Provide for a graceful "No code coverage available" scenario

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.

Inconsistant coverage reporting compared to PHPUnit

PHPunit, on a test suite that provides 100% coverage of a class gives me

Screenshot 2020-02-24 16 07 02

Behat coverage, with a suite which I think gives 100% coverage gives me

Screenshot 2020-02-24 16 08 17

or (different method but similar code)

Screenshot 2020-02-24 16 08 32

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.