Coder Social home page Coder Social logo

leanphp / phpspec-code-coverage Goto Github PK

View Code? Open in Web Editor NEW
60.0 4.0 37.0 110 KB

Generate Code Coverage reports for PhpSpec tests

Home Page: https://packagist.org/packages/leanphp/phpspec-code-coverage

License: Other

PHP 100.00%
php phpspec code-coverage bdd bdd-specs php7 unittest testing-tools phpspec-extension coverage-report

phpspec-code-coverage's People

Contributors

andreybolonin avatar anyqax avatar davidgarciacat avatar digitalkaoz avatar ek9 avatar exu avatar fesor avatar firstrow avatar franmomu avatar gabiudrescu avatar grahamcampbell avatar henrikbjorn avatar iambrosi avatar kwisatz avatar lookitsatravis avatar mediagone avatar michaldudek avatar milan avatar nyholm avatar piorek avatar raphaelstolt avatar renanivo avatar rnijveld avatar robinvdvleuten avatar roukmoute avatar sam-burns avatar scrutinizer-auto-fixer avatar seldaek avatar svemir avatar wimvds 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

phpspec-code-coverage's Issues

PHP 7+ focused release

It would be nice to have a PHP7+ targeted release. Perhaps some parts of the code can be cleaned up for this.

phpspec v5

Hi

Are there any plans for supporting phpspec v5 in the near future? :)

Ability to disable coverage generation.

Running phpspec with coverage brings my total tests (5 right now) to a 1 to 1.5second execution time.
While running it without coverage (by commenting out the configuration) has a 100ms or less execution time.

Is it possible that we can run phpspec like: phpspec run --no-coverage or maybe even turn it around like
phpspec run --coverage like phpunit has it?

Since I don't nessecarilly want to ALWAYS generate coverage, especially at development.

Wrong phpunit/php-code-coverage version requirements for version 4.0.0

Version 4.0.0 requires phpunit/php-code-coverage version ~4.0||~5.0 but attempts to use code from version 5 regardless.

Lines 82 - 84 of CodeCoverageExtension:

case 'xml':
    $reports['xml'] =  new Report\Xml\Facade(Version::id());
    break;

This doesn't work because class SebastianBergmann\CodeCoverage\Version was only added in version 5.0.0. I'm using 4.0.8 and I'm getting a fatal error instead. An upgrade is not an option, since I'm stuck with PHPUnit 5.7 which requires phpunit/php-code-coverage ^4.0.4 (legacy codebase).

Class Report\Xml\Facade doesn't expect any constructor arguments which means that Version::id() part can be safely removed.

Is there a chance a fix could be released as a 4.0.1? I could fix the issue myself but there's no v4.0 branch to create a pull request to.

Support providing configuration parameters via CLI

Support specifying code coverage configuration parameters via cli instead of only supporting configuration file. In case both (configuration and CLI arguments) are specified, the CLI arguments should always take priority.

Set of arguments we need to support:

  • --coverage-clover <file> - Generate code coverage report in Clover XML format
  • --coverage-crap4j <file> - Generate code coverage report in Crap4J XML format
  • --coverage-html <dir> - Generate code coverage report in HTML format
  • --coverage-php <file> - Export PHP_CodeCoverage object to file
  • --coverage-text=<file> - Generate code coverage report in text format Default: Standard output
  • --coverage-xml <dir> - Generate code coverage report in PHPUnit XML format
  • --whitelist <dir> - Whitelist <dir> for code coverage analysis
  • --disable-coverage-ignore - Disable annotations for ignoring code coverage

For relevant discussion see #11 (esp. #11 (comment) )

`--no-coverage` argument bugfixes

  • Fix error regarding --no-coverage when running other commands than run
  • --no-coverage argument will be added to all commands, to allow skipping coverage generation (currently it is only supported by run command). See #29 for a usecase

Functional / Integration tests

As of #19 the functional / integration tests was disabled. The tests were previously written in PhpSpec and now cannot run anymore due to phpunit/php-code-coverage marking their classes as final (we cannot mock them anymore).

As a result of #19 we need new functional tests.

Documentation suggestion

I was struggling to get this working with phpdbg on a project with a moderately large number of tests ( > 1400 phpspec examples), no code coverage was being generated. Eventually I noticed that I was getting an exit code of 255.

The problem was the memory_limit in phpdbg's php.ini - it would probably help others to add a note to the readme to suggest that the memory_limit there should be set to -1.

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.