Add Test Coverage metrics to GCMC code repository
Feature description
No (?) tests for the Bitbucket code were migrated from the GCMW, minimal tests have since been added.
I'd like to potentially refactor the Bitbucket code, but would like to add more tests first. Test Coverage metrics would help to identify areas in need of new tests.
Potential Solution
Coverlet and the configuration described here https://josh-ops.com/posts/github-code-coverage/ would ultimately lead to an environment where
- Coverage metrics are generated during CI
- Coverage metrics are reported on the repo and during PRs
- Potentially enforce/increase a minimal coverage level.
However this configuration is dependent on a single file of coverage metrics, this is currently not possible using Coverlet, https://github.com/coverlet-coverage/coverlet/issues/1015#issuecomment-746174446
Intermediate Solution
It would be possible to add Coverlet to the project and incrementally move to the final desired state.
MVP
- Add Coverlet to the project to generate metrics
- Add ReportGenerator to the project to generate HTML reports of the metrics
- Add documentation on how to generate a coverage report
CI
- Extend CI configuration to generate Coverage Report
- Make the report accessible as an artefact from CI
Full integration
- As described in https://josh-ops.com/posts/github-code-coverage/
First pass implementation is here https://github.com/microsoft/Git-Credential-Manager-Core/pull/499
https://github.com/GitCredentialManager/git-credential-manager/pull/499 merged code coverage.
https://github.com/GitCredentialManager/git-credential-manager/pull/607 refactors the Bitbucket tests
Hey @mminns! Did you have any additional plans to extend test coverage/update more tests, or are we ok to close this issue?
Closing - can re-open if we decide to add additional coverage.