-
Notifications
You must be signed in to change notification settings - Fork 18
Concepts
This tool tracks coverage of a pull request. This changes based on the input.
phpunit only considers lines with code on, This comes back in the clover file, so a more accurate measure can be used.
For example, 15 lines have changed, 5 lines in tests, 10 lines in source. 6 of these lines had code them 4 of them were just whitespace.
If 1 line of code did not have a test, 1/6 lines are not covered = 84% coverage (5/6 lines)
Other tools which only provide the lines which do not comply have a differnt calculation method.
Same example as above, all of the lines are now considered, so 1/15 is not covered = 93% covered (14/15 lines)
Covered in this case means that the tool has not reported an error for the line. So a phpcs line not covered means the coding standard check has 1 line with a standards violation
When using the minimum coverage, the build will fail if below the number (exit code > 0) or show in the output itself it has failed.
Eg if the diff coverage is 93%, a minimum of 90% would pass this build, a minimum of 95% would fail this.
The minimum is passed in as follows
diffFilter --phpcs diff.txt phpcs.json 95
95 in the above example would be the minimum. If no minimum is provided a minimum of 100% is assumed. This means there has to be 0 lines with a violation on it