Closed JohnLudlow closed 1 year ago
Thanks for your detailed description. The behavior in the chart in by design. Only if coverage changes from one execution to next one, a point is added to the chart. I guess in your case the coverage did not change, so only one point is added to the chart.
If you make changes in your code base additional points should appear in the chart.
Here you'll find the relevant methods in ReportGenerator: https://github.com/danielpalme/ReportGenerator/blob/9e22aaa410201ae9dcbeca957fee3d90998f27a9/src/ReportGenerator.Core/Reporting/Builders/Rendering/HtmlRenderer.cs#L1927-L1942
Regarding the date format: You are right, this is not perfect. I will see what I can do about it.
I guess that explains it then!
I might wait and see if there's any work that affects the coverage on the project I picked as a guinea pig and then have another go and see whether it makes a difference.
Thanks
I just took a look how the date string is generated.
It is build with the culture you run "ReportGenerator" with:
So maybe you can execute ReportGenerator with the desired culture.
Describe the bug We have code coverage reporting set up and running in Azure Pipelines using the Azure Pipelines task, and we wanted to add history. Unfortunately, despite harvesting and processing a number of history files, we see a graph with no historical data, just a single point for each series.
We see something similar if I download the report artifact and unzip it:
Note how several history files have been picked up but only 1 point is shown on the graph
Output of the task in Azure DevOps:
To Reproduce
coverlet.msbuild
andcoverlet.collector
are installed into the unit test projectdotnet test --collect:"XPlat Code Coverage"
PublishCodeCoverageResults@1
taskExpected Behaviour: Successfully creating a report with a graph as seen in the examples (e.g https://reportgenerator.io/resources/reports/Html/index.html). If you haven't changed the tests much, you could expect the coverage to not have changed so the graph would be flat lines with a point for each build, or a point for each day the build was run.
Actual Behaviour Creates a report with a graph with a single point for each series as shown in the screenshots above. Also note there seems to be a disparity between the graph, the supposed date range shown in the report header, the options in the "Compare with" drop down, and the files that were logged as being processed.
Aside As an aside, the dates always seem to be in US MM/DD/YYYY format which can be confusing for people outside the US. It'd be nice if the page detected regional settings, used an unambiguous YYYY/MM/DD format or allowed the format to be selected.