Coder Social home page Coder Social logo

d0x2f / clovermerge Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 7.0 107 KB

Utility to merge two or more clover files into a single document.

License: MIT License

PHP 97.14% Dockerfile 0.42% Shell 2.44%
clover clover-files composer-dependency coverage devops-tools docker-image php

clovermerge's People

Contributors

d0x2f avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clovermerge's Issues

3rd party coverage check tool shows wrong coverage stats

I am using rregeer/phpunit-coverage-check to check coverage threshold.

It seems phpunit-coverage-check tool only getting the coverage of one of xml files, not combined coverage.

$ ./vendor/bin/clover-merge -m exclusive -o build/logs/clover_merged.xml build/logs/clover_kahlan_functional.xml build/logs/clover_kahlan_unit.xml
Files Discovered: 85
Final Coverage: 1049/1479 (70.93%)

$ ./vendor/bin/coverage-check build/logs/clover_merged.xml 100 
Total code coverage is 49.76%, which is below the accepted 100%

Is it possible to let 3rd party tool can read combined coverage ?

Command not working

When I try to use clover-merge command, I get an error

fatal error: Uncaught Error: Class 'd0x2f\CloverMerge\Invocation' not found in /code/vendor/php/d0x2f/clover-merge/clover-merge:6
Stack trace:
#0 {main}
  thrown in /code/vendor/php/d0x2f/clover-merge/clover-merge on line 6

The Invocation class seem not to be found.

Merge metrics does not work properly

Before merging interesting part of the XML file looks like:

      <file name="/src/Exception/AliasNotFoundExceptionProcessor1.php">
        <class name="ACME\Processor\Exception\AliasNotFoundExceptionProcessor1" namespace="ACME\Processor\Exception">
          <metrics complexity="1" methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="0" elements="3" coveredelements="0"/>
        </class>
        <line num="12" type="method" name="process" visibility="public" complexity="1" crap="2.00" count="0"/>
        <line num="14" type="stmt" count="0"/>
        <line num="15" type="stmt" count="0"/>
        <metrics loc="16" ncloc="16" classes="1" methods="1" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="0" elements="3" coveredelements="0"/>
      </file>

and after merging class->metrics disappeared at all and file->metrics is changed with metrics from class->metrics, like this:

      <file name="/src/Exception/AliasNotFoundExceptionProcessor1.php">
        <class name="ACME\Processor\Exception\AliasNotFoundExceptionProcessor1" namespace="ACME\Processor\Exception"/>
        <line num="12" type="method" name="process" visibility="public" complexity="1" crap="2.00" count="0"/>
        <line num="14" type="stmt" count="0"/>
        <line num="15" type="stmt" count="0"/>
        <metrics complexity="0" elements="3" coveredelements="0" conditionals="0" coveredconditionals="0" statements="2" coveredstatements="0" methods="1" coveredmethods="0" classes="1"/>
      </file>

Add an optional flag to only add to lines from the first input file.

With this flag enabled, lines in the first input file will be modified (hits increased) but no new lines will be added.

This allows a merged result to include only the lines present in the first file so that omissions based on in-code "ignore line" comments are effectively applied to subsequent input files also.

Is this project still maintained?

Hey,

we have multiple testsuites in PHPUnit and I want to merge the result coverage file. This tool looks like not working with new PHP versions anymore.

I could make an PR if wanted

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.