d0x2f / clovermerge Goto Github PK
View Code? Open in Web Editor NEWUtility to merge two or more clover files into a single document.
License: MIT License
Utility to merge two or more clover files into a single document.
License: MIT License
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 ?
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.
Useful in build pipelines to enforce a minimum coverage.
I'm thinking --enforce/-e
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>
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.
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
This would be useful to quickly determine if the merge worked as expected or not.
Coverage percent output also allows many CI solutions to parse and report it (gitlab in my case).
This flag will ensure that the merged result only contains lines analyzed by all input reports.
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.