GoEddie / SQLCover

Apache License 2.0
63 stars 52 forks source link

Allign to the OpenCover format https://github.com/csMACnz/coveralls.net is using #77

Open snowliver opened 2 years ago

snowliver commented 2 years ago

Hi @GoEddie and thanks for your efforts.

There is a fileid attribute on each SequencePoint. https://github.com/OpenCover/opencover/blob/e715910bb52e327ae6df059aeea71dff4b54ee50/main/OpenCover.Framework/Model/SequencePoint.cs#L35

I'm directly feeding it into the coveralls uploader https://github.com/csMACnz/coveralls.net, without using the reportgenerator.

For now, I use this Powershell snippet as a workaround, to make it working in my TeamCity Build.

[xml]$xmldocument = Get-Content -Path "./SQLCoverResults.xml"
Foreach ($class in ($xmldocument.CoverageSession.Modules.Module.Classes.GetElementsByTagName("Class"))) {
    $fileref = $class.Methods.Method.FileRef.uid
    foreach ($SequencePoint in $class.Methods.Method.SequencePoints.GetElementsByTagName("SequencePoint")) {
        $SequencePoint.Setattribute("fileid",$fileRef)
    }
}
$xmldocument.Save("./SQLCoverResults_2.xml");`

Not sure if you see this issue more here or in coveralls.net .

Thanks Oli