Open shankari opened 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.
@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 :)
It seems that basically everyone uses coverage.py/pytest-cov for python. Difficult to even find information about what else is out there.
Actions options:
Codecov: https://about.codecov.io/blog/python-code-coverage-using-github-actions-and-codecov/
Coveralls: https://github.com/marketplace/actions/coveralls-python
Community options
Hack it up ourselves
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.
@aGuttman I agree with both your recommendations:
coverage.py/pytest-cov
for the actual code coverage; it looks like we don't have a lot of choice anywayCan you implement at least the first step and get the current code coverage before our meeting with the cloud folks on Monday?
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.
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)
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.