Skip to content
This repository has been archived by the owner on Jun 17, 2023. It is now read-only.

Support for test coverage diff report #103

Open
arturmatos opened this issue Mar 6, 2018 · 1 comment
Open

Support for test coverage diff report #103

arturmatos opened this issue Mar 6, 2018 · 1 comment

Comments

@arturmatos
Copy link

Didn't find anything like this either as an old issue or as a plugin so I decided to post it here. Perfectly happy to develop it myself as a plugin (assuming it is feasible).

I would like to have a imhotep plugin that adds a coverage difference report to PRs as a comment on top. Something like this:

Filename          Stmts    Miss    Cover     Missing
----------------  -------  ------  --------  ---------
dummy/dummy.py    -        -2      +50.00%   -2, -5
dummy/dummy2.py   +2       -       +100.00%
TOTAL             +2       -2      +50.00%

I think this will be very helpful to see test coverage improvements with each PR.

There are several tools for this including pycobertura and diffcover. Assuming pycobertura I would need to do this:

  • Check master
  • Check code under the given PR
  • Run pytest with coverage on for master
  • Run pytest with coverage on for the given PR.
  • Run pycobertura diff coverage.old.xml coverage.new.xml --source1 old_source/ --source2 new_source/. This will generate a text report
  • Return that from imhotep invoke(). The output would have to be for the whole PR and not for specific lines. Does imhotep supports this?

Would this be something sensible? Happy to develop it as a separate plugin but I'll need some guidance.

@justinabrahms
Copy link
Owner

justinabrahms commented Mar 27, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants