danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
https://reportgenerator.io
Apache License 2.0
2.53k stars 276 forks source link

Add a delta-coverage summary report (txt and/or md) #534

Closed manfred-brands closed 1 year ago

manfred-brands commented 2 years ago

For a pull-request the coverage should not go down. Either more test on existing code is added or new code is accompanied with corresponding tests.

Given a 'main' branch coverage in a history.xml format (from a report generator run on the main branch) Then run report generator on the PR branch.

Create a delta report sort of the one from coverlet but then matching the wording of your other summary reports. Instead of one, it would have three columns: main, branch, delta Roughly like:

Generated on: 15/07/2022 - 15:26:

Item                        Main                    Branch                  Delta
Coverage date:              15/07/2022 - 15:21      15/07/2022 - 15:25
Parser                      Cobertura               Cobertura
Assemblies                  1                       1                       0
Classes:                    1                       1                       0
Files:                      1                       1                       0
Line coverage:              14.2%                   57.1%                   42.9%
Covered lines               1                       4                       3
Uncovered lines:            6                       3                       -3
Coverable lines:            7                       7                       0
Total lines:                19                      19                      0

Simple.Calculator           14.2%                   57.1%                   42.9%
  Simple.Calculator         14.2%                   57.1%                   42.9%
danielpalme commented 1 year ago

I merged your PR and also added a MarkdownDeltaSummary report. New release will be available within the next days.