git-credential-manager icon indicating copy to clipboard operation
git-credential-manager copied to clipboard

Add Test Coverage metrics to GCMC code repository

Open mminns opened this issue 4 years ago • 2 comments

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/

mminns avatar Oct 19 '21 14:10 mminns

First pass implementation is here https://github.com/microsoft/Git-Credential-Manager-Core/pull/499

mminns avatar Oct 19 '21 14:10 mminns

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

mminns avatar Mar 17 '22 20:03 mminns

Hey @mminns! Did you have any additional plans to extend test coverage/update more tests, or are we ok to close this issue?

ldennington avatar Feb 13 '23 22:02 ldennington

Closing - can re-open if we decide to add additional coverage.

ldennington avatar Apr 10 '23 21:04 ldennington