You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally reported byJon Dufresne (Bitbucket: jdufresne, GitHub: jdufresne)
If the test coverage is just a small fraction below the fail-under value, the report will fail with a non-zero exit status (good and expected) but the report appears as if everything is ok. As an example I received the following report:
$ coverage report --fail-under=70
Name Stmts Miss Cover Missing
---------------------------------------------------------------------
...
---------------------------------------------------------------------
TOTAL 1816 551 70%
$ echo $?
2
Doing the math:
>>> (1816.0 - 551.0) / 1816.0
0.6965859030837004
This is indeed below 70%. However at first glance, coverage reports this as 70% coverage (due to rounding I assume) creating confusion for me the user. In the case of failure, I would like to see report provide a more precise number for coverage so that the failure is immediately obvious.
Hmm, it seems odd to me to change the reporting based on whether --fail-under is used or not. Better I think would be to use the rounded number in the fail-under calculation.
Original comment byJon Dufresne (Bitbucket: jdufresne, GitHub: jdufresne)
Hmm, it seems odd to me to change the reporting based on whether --fail-under is used or not. Better I think would be to use the rounded number in the fail-under calculation.
Sure. I think this solution makes sense and would remove the confusion.
Originally reported by Jon Dufresne (Bitbucket: jdufresne, GitHub: jdufresne)
If the test coverage is just a small fraction below the
fail-under
value, the report will fail with a non-zero exit status (good and expected) but the report appears as if everything is ok. As an example I received the following report:Doing the math:
This is indeed below 70%. However at first glance,
coverage
reports this as 70% coverage (due to rounding I assume) creating confusion for me the user. In the case of failure, I would like to seereport
provide a more precise number for coverage so that the failure is immediately obvious.The text was updated successfully, but these errors were encountered: