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.62k stars 283 forks source link

ReportGenerator 5.1.18 fails with reading historic reports #596

Closed lvanzijl closed 1 year ago

lvanzijl commented 1 year ago

Since upgrading to 5.1.18 I am not able to use the reportgenerator anymore. Previous version was 5.1.17 which ran successful a week before.

So you have enough information in the logging below or do you require more details? (I anonymized namespaces a bit in the log)

Starting: ReportGenerator
==============================================================================
Task         : ReportGenerator
Description  : 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.
Version      : 5.1.18
Author       : Palmmedia
Help         : [More Information](https://github.com/danielpalme/ReportGenerator)
==============================================================================
"C:\Program Files\dotnet\dotnet.exe" T:\work_a2\_tasks\reportgenerator_be803a55-9253-4895-a525-be570d86f161\5.1.18\tools\netcoreapp3.1\ReportGenerator.dll -reports:T:\work_a2\1037\a/Test/Results/**/In/**/*.cobertura.xml -targetdir:coveragereport -reporttypes:HtmlInline_AzurePipelines;Cobertura;Badges -sourcedirs: -historydir:\\aa-sr-sci-ap-01\ReleaseShare\Dsac\CodeCoverageHistory\ads-viewer -plugins: -assemblyfilters:+* -classfilters:+* -filefilters:+* -verbosity:Info -title: -tag:AAAAAAViewer_2.3.0.106742_#106742 -license:
2023-03-02T08:08:36: Reading historic reports
2023-03-02T08:08:36: An item with the same key has already been added. Key: AAAA.Viewer.Service.Logic+AAAA.Viewer.Service.Logic.AAAA.Support.DistributableClientDdsHandler<TClient, TUpdateStore>
2023-03-02T08:08:36:    at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
   at Palmmedia.ReportGenerator.Core.Reporting.History.HistoryParser.ApplyHistoricCoverage(IEnumerable`1 assemblies, List`1 overallHistoricCoverages) in /_/src/ReportGenerator.Core/Reporting/History/HistoryParser.cs:line 89
   at Palmmedia.ReportGenerator.Core.Generator.GenerateReport(IReportConfiguration reportConfiguration, Settings settings, RiskHotspotsAnalysisThresholds riskHotspotsAnalysisThresholds, ParserResult parserResult) in /_/src/ReportGenerator.Core/Generator.cs:line 245
   at Palmmedia.ReportGenerator.Core.Generator.GenerateReport(IReportConfiguration reportConfiguration, Settings settings, RiskHotspotsAnalysisThresholds riskHotspotsAnalysisThresholds) in /_/src/ReportGenerator.Core/Generator.cs:line 145
##[error]The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
danielpalme commented 1 year ago

This issue is not related to version 5.1.18. Somehow your code base contains a class where AssemblyName + Classname is no longer unique.

Version 5.1.19 should fix this issue. Could you please try again? New release should be available in a few minutes.

lvanzijl commented 1 year ago

Thanks for the quick fix ! When I encountered this bug I looked through the changesets but couldnt find anything even remotely close to that namespace, but if it's fixed now that doesnt really matter :).

I have to wait for our onprem azure devops to run the update extensions task to get the new version, I hope to be able to test the new version tomorrow (gmt+1).

lvanzijl commented 1 year ago

While I was typing this the extension was updated, Its fixed now thanks!