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

Handling missing type_name attribute #584

Closed sergesh78 closed 1 year ago

sergesh78 commented 1 year ago

type_name attribute might be ommited when empty, need to handle that

sergesh78 commented 1 year ago

While updating our code coverage collector, we noticed that new files can't be processed by ReportGenerator. The issue was that new tool doesn't output type_name and name attributes to XML if their value is empty string to reduce output file size.

danielpalme commented 1 year ago

Thanks for you PR. Will merge it within the next days. Which "coverage collector" are you referring to? Is this tool available to the public?

sergesh78 commented 1 year ago

It happened on one of the internal betas of Microosft.CodeCoverage tools, so I assume it will make its way to the public release of Visual Studio in time. As I mentioned, whenever the public version emits an attribute with an empty string, the new version doesn't emit the attribute at all, probably to reduce output file size.

On Mon, Jan 23, 2023 at 4:15 AM Daniel Palme @.***> wrote:

Thanks for you PR. Will merge it within the next days. Which "coverage collector" are you referring to? Is this tool available to the public?

— Reply to this email directly, view it on GitHub https://github.com/danielpalme/ReportGenerator/pull/584#issuecomment-1400015825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGITEXBOB5JREOWO6IGKZ3WTZD2RANCNFSM6AAAAAAUB6HEUQ . You are receiving this because you authored the thread.Message ID: @.***>

-- Best,

Sergey.

sergesh78 commented 1 year ago

Just got a reply from code coverage devs, they are saying that cobertura format dictates that those fields are required, so they will always output fields for cobertura, but will keep current behaviour for XML output. So I will revert my changes to cobertura parser.

On Mon, Jan 23, 2023 at 10:30 AM Sergey - @.***> wrote:

It happened on one of the internal betas of Microosft.CodeCoverage tools, so I assume it will make its way to the public release of Visual Studio in time. As I mentioned, whenever the public version emits an attribute with an empty string, the new version doesn't emit the attribute at all, probably to reduce output file size.

On Mon, Jan 23, 2023 at 4:15 AM Daniel Palme @.***> wrote:

Thanks for you PR. Will merge it within the next days. Which "coverage collector" are you referring to? Is this tool available to the public?

— Reply to this email directly, view it on GitHub https://github.com/danielpalme/ReportGenerator/pull/584#issuecomment-1400015825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGITEXBOB5JREOWO6IGKZ3WTZD2RANCNFSM6AAAAAAUB6HEUQ . You are receiving this because you authored the thread.Message ID: @.***>

-- Best,

Sergey.

-- Best,

Sergey.

danielpalme commented 1 year ago

Can you provide a sample coverage file where the "type_name" attribute is missing? Would like to take a look at the new format and add some additional tests.

sergesh78 commented 1 year ago

Hi sorry for waiting, but looks like Visual Studio team after debates decided to revert the change completely, I'm testing their revert now and will update tomorrow.

On Mon, Jan 23, 2023 at 2:39 PM Daniel Palme @.***> wrote:

Can you provide a sample coverage file where the "type_name" attribute is missing? Would like to take a look at the new format and add some additional tests.

— Reply to this email directly, view it on GitHub https://github.com/danielpalme/ReportGenerator/pull/584#issuecomment-1400878688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGGITEV3ZW77FY2VDJUZSHLWT3M7HANCNFSM6AAAAAAUB6HEUQ . You are receiving this because you authored the thread.Message ID: @.***>

-- Best,

Sergey.