Reportgenerator: Question - Method summary

Created on 6 Sep 2018  路  8Comments  路  Source: danielpalme/ReportGenerator

Hi Daniel and thanks for a great project.

I was wondering if it was somehow possible to create a report like the XmlSummary that included the methods as well as the classes? The reason I am asking is that I am creating this task in Vs Code that runs the tests with test coverage and then uses ReportGenerator to determine if there are code not covered by my tests. If that happens I would like to be able to navigate to that method as quickly as possible. From the XmlSummary I can spit out information about the offending class, but I would have to "manually" look up the method. I know I can generate a Html report and look there, but preferably I would want to get this information just by looking at the console output from running the tests with code coverage. Possible?

help wanted

All 8 comments

Yes, that should be possible.

You could create a custom report. See this explanation.

Which version of ReportGenerator are you using?
The wiki page is only helpful for the 3.x releases.

If you are already using the 4.x pre-releases, you can also write plugins, but there are two issues:

  • I have not written any documentation
  • I probably have to change assembly loading and plugin handling for 4.x since dynamically loading classes at runtime in .NET Core is different

I would suggest the following:
Let me know which version of ReportGenerator you are using, then I can help with some sample code.

Hi and thanks for your quick response.

I am using the dotnet-reportgenerator-cli 4.0.0-rc4.

Yeah, I looked into custom reports, but I just wanted to make sure that there wasn't an undocumented command line argument for this 馃槃 Guess I'll figure something out if you could just point me in the right direction with regards to some boilerplate stuff that spits out coverage per method 馃憤

Since I am using the cli tool reference version I wasn't quite sure where to put the plugin.

On a sidenote, if you are looking for way to handle plugins on .Net Core, you should check out this blogpost by @natemcmaster https://natemcmaster.com/blog/2018/07/25/netcore-plugins/

What coverage tool are you using? OpenCover, coverlet?

Thanks for the link regarding the plugins. I have already read that.

Oh, I am using coverlet 馃憤

Btw, I tried using ReportGenerator.Core and generate the report from C# code, but I could not find a pass in my custom report implementation

Just created a plugin which creates the coverage based on the _sequenceCovage_ metric:
Palmmedia.ReportGenerator.XmlPlugin.zip

It should work if you save the DLL in the "lib\netcoreapp2.0\" directory of the Nuget package.
On my machine that's:
%userprofile%\.nuget\packages\dotnet-reportgenerator-cli\4.0.0-rc4\lib\netcoreapp2.0

The idea for the next release is, that you can pass a plugin directory to ReportGenerator.

Thanks a lot for your help 馃憤

You're welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stephentoub picture stephentoub  路  6Comments

hannahchan picture hannahchan  路  3Comments

ByteDecoder picture ByteDecoder  路  6Comments

wsugarman picture wsugarman  路  4Comments

yuichi-github picture yuichi-github  路  4Comments