Closed kremalicious closed 3 years ago
Found ocean.py on Codacy but looks like we do not send any code coverage reports to there, or it's broken. Until that is solved there is no badge to display https://app.codacy.com/gh/oceanprotocol/ocean.py
@kremalicious Can we do something like this? It doesn't include third parties: https://itnext.io/github-actions-code-coverage-without-third-parties-f1299747064d
sure, whatever works without too much maintenance on our part. Also depends on what backend team chooses to monitor and measure code coverage and code quality. But in the end everything works which provides us with PR status notifications based on diff coverage. On js repos we use CodeClimate and it also posts this PR comments like https://github.com/oceanprotocol/ocean.js/pull/622#issuecomment-784305049. But pretty sure that's all possible to put together in GitHub Actions too
Codacy docs show how to create badges.
How: in codacity.com, go to repo's settings page, scroll to the bottom, generate a badge, and copy the code. Here's the ocean.py page.
So I did this! And I added the badge into ocean.py's README, in this commit: https://github.com/oceanprotocol/ocean.py/commit/085a8e8bd6b70e2d51230add20c24d1a2f563ea9
However it doesn't complete this issue, since it's only a grade for code quality, not for code coverage. But it's a start.
(And I see that ocean.js has like 10 badges, cool! Challenge accepted :P )
Towards the actual issue at hand, it appears that we can get Codacy to generate coverage reports. That page links to using the coverage
tool for python, which is already in setup.py's list of imports for dev tools. If the report is properly generated, perhaps Codacy will give us a badge for it.
Problem
Hard to figure out what the current code test coverage is (69%) cause it can only be found here: https://travis-ci.com/github/oceanprotocol/ocean.py/jobs/480270206#L696
Suggested solution There should be a badge in the readme, sourced from whatever tool is used here to collect the coverage reports.
Example: ocean.js readme badges line: https://github.com/oceanprotocol/ocean.js
Notes After this is done, a good follow-up is: #146 Only allow code merges if unit test code coverage ratchets up