1
votes

Running Build on TFS 2015 On Permises and my code coverage result Task logs warning saying that coverage data not found. But the xml file was read during the build process. enter image description here

I have configured the Publish Code Coverage Results like described in the picture: enter image description here

The logs during build are saying that the file was produced and it was read.

enter image description here

and at the end of all files it says this:

enter image description here

I was expecting to see some code coverage resume data on the build, but that was not the case:

enter image description here

1
Is it generating results in the Cobertura format? If not, telling it to parse results in the Cobertura format won't work.Daniel Mann

1 Answers

0
votes

Thanks @DanielMann that reminder helped. Im using openCover and i was not understanding that OpenCover had is own format. Now I change my Cake script to support conversion from openCover to Cobertura.

I added the headers in the cake script like this:

#addin "nuget:?package=Cake.OpenCoverToCoberturaConverter&version=0.1.1.2"
#tool "nuget:?package=OpenCoverToCoberturaConverter&version=0.3.2"

and then after tests executed with sucess I run my code coverage like this:

OpenCover(tool => {
                                tool.XUnit2($"{testsPath}/**/**/**/**/{projectName}.dll",xUnit2Settings);
                        }, new FilePath("./OpenCoverCoverageResults.xml"),openCoverSettings);

         OpenCoverToCoberturaConverter("OpenCoverCoverageResults.xml", "CoberturaCoverageResults.xml");
         ReportGenerator($"CoberturaCoverageResults.xml", $"{outputDir}/Reports");