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.
I have configured the Publish Code Coverage Results like described in the picture:
The logs during build are saying that the file was produced and it was read.
and at the end of all files it says this:
I was expecting to see some code coverage resume data on the build, but that was not the case:
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");