Skip to content

Coverage Thresholds #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rdohms
Copy link

@rdohms rdohms commented Sep 21, 2010

I have added support to configure the threshold that makes a method or class be marked as tested. Currently 100% of method lines need to be tested before its marked as tested, but i have ran into a few situations where its impossible to get that 100% (either bad design or xdebug issues) so the method remains marked as not tested.

With this patch i can specify that if 90% of lines are tasted the method can then be accepted as tested, much like the low and high bounds.

Question:
I was able to add the 2 options to the HTML reports and all the way down to the File.php, however i did not figure out how to call this option from the command line like --html ./_reports --methodCoverageThreshold 90 or something like that, other then registering the option itself, and i thought it should be available as the yui and highlight methods are.

Let me know if this sounds useful or it violates some basic rule of testing, if you think its useful, i'll finish up the unit tests for it. Still running phpunit 3.4 here so i had a few issues running the suite.

Cheers! Pity you are leaving Orlando before i get there on sunday, we could have scheduled a dinner, well next year at tek hopefully.

- methodCoverageThreshold: what percentage of lines must be tested for method to be marked as tested
- classCoverageThreshold: what percentage of functions must be tested for class to be marked as tested

Still pending their addition to command line parsing, have not found the way yet.
@sebastianbergmann
Copy link
Owner

Won't pull, sorry. I think it is better to explicitly ignore lines that you cannot test instead of globally reduing the percentage of lines of code required to mark a method as tested.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants