AArnott / Library.Template

A template for a NuGet package with tests, stylecop, fxcop, versioning, and Azure Pipelines build ready to go.
MIT License
128 stars 26 forks source link

Enable code coverage history #7

Open AArnott opened 5 years ago

AArnott commented 5 years ago

The ReportGenerator supports producing reports with code coverage graphs. Although ADO doesn't have this built-in, we could generate our own HTML reports that includes this graph as part of our merge coverage job.

To accumulate history, each build could:

  1. Download a history artifact from the prior build from that same branch.
  2. Contribute a merged coverage file to that directory
  3. Remove very old reports to keep the number of files in the artifact to some max number (e.g. 20).
  4. Publish the updated artifact.

Storing history as a build artifact would allow history to always be based on past builds from a given branch, even old servicing branches would maintain history so long as we have a prior build for that branch.

AArnott commented 5 years ago

As we'll be publishing our own HTML report, keep in mind https://github.com/tonerdo/coverlet/issues/474#issuecomment-504435186 which explains how to suppress the automatic regeneration of HTML reports by the ADO task.