e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 34 forks source link

Estimate code coverage for the current server codebase #729

Open shankari opened 2 years ago

shankari commented 2 years ago

The current server codebase https://github.com/e-mission/e-mission-server has automated tests https://github.com/e-mission/e-mission-server/tree/master/emission/tests and continuous integration https://github.com/e-mission/e-mission-server/tree/master/.github/workflows

We would like to now estimate the code coverage of this test suite, with a view towards improving it in the future. A potential code coverage tool is https://github.com/nedbat/coveragepy, but we should look at other options as well.

Ideally, the selected tool would have a GitHub action that we could use to compute the code coverage. We could display the current code coverage as a button (see below)

Screen Shot 2022-05-17 at 4 52 08 PM

and even the difference as part of a pull request - e.g. something like https://josh-ops.com/posts/github-code-coverage/

This will allow us to maintain the coverage over time.

shankari commented 2 years ago

@aGuttman, can you update this with the design decisions behind the choice of the code coverage tool? You could also document your findings as you explore the tool and choose config options so we know why the options were chosen.

shankari commented 2 years ago

@aGuttman Here's a tool that converts code coverage reports into human readable text https://reportgenerator.io/ It also seems to have a list of code coverage tools :)

aGuttman commented 2 years ago

It seems that basically everyone uses coverage.py/pytest-cov for python. Difficult to even find information about what else is out there.

aGuttman commented 2 years ago

Actions options:

I've barely used GitHub actions. I can get the simple stuff to work with my current knowledge, might need time to understand more involved actions but it does't look too bad. The community options look good to me, I don't feel like we need the fancy charts, and are still easy to use.

shankari commented 2 years ago

@aGuttman I agree with both your recommendations:

Can you implement at least the first step and get the current code coverage before our meeting with the cloud folks on Monday?

aGuttman commented 2 years ago

Yes, definitely. Coverage is easy to use and I've been playing around with different actions in my fork so it all basically works already, I just need to settle on an implementation and hammer out any details along the way.