Open keiranmraine opened 2 years ago
Just to say, firstly, thanks for creating and open-sourcing this Github action, it's very useful, and secondly, supporting the --cov-branch
flag would also be very helpful for me. We have a separate Github Actions workflow that does all of our CI checks, including a code coverage threshold check, and for that we generate the report with the pytest --cov-branch
flag set.
Like @keiranmraine, I realised that using this flag breaks the table in the PR comment from pytest-coverage-commentator
, so I have to leave that out when running the action. However, that means that the code coverage number in the comment disagrees with the one in our CI build, which causes some confusion:
--cov-branch
Name Stmts Miss Branch BrPart Cover
-----------------------------------------------------
aws_helper.py 35 0 2 0 100%
docker_helper.py 15 0 0 0 100%
matesto.py 123 22 28 2 79%
report_2_slack.py 64 11 8 1 81%
utils.py 54 0 0 0 100%
-----------------------------------------------------
TOTAL 291 33 38 3 86%
--cov-branch
Name Stmts Miss Cover
---------------------------------------
aws_helper.py 35 0 100%
docker_helper.py 15 0 100%
matesto.py 123 22 82%
report_2_slack.py 64 11 83%
utils.py 54 0 100%
---------------------------------------
TOTAL 291 33 89%
When branch coverage is used the output isn't parsed by the headers, always assumes Stmnts, Miss, Cover.
When branch is used:
But get:
(final line relating to #98)