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");
Related
I have a build definition that runs grunt build and generates code coverage results using cobertura tool in cobertura.xml files. The cobertura.xml is used in Publish code coverage result task to publish code coverage result on VSTS build summary.
Along with cobertura.xml file, I have one Index.html file present in same folder which also contains code coverage result in detail. I want to call Index.html file using publish code coverage result task to display code coverage result on build summary instead of cobertura.xml.
I tried doing that by passing the name of index.html along with its path in the publish task but it fails.
Is there any way by which I can display the code coverage using index.html?
I am using TFS 2017 Update3 and I have a Build definition which runs Grunt build task at two different HTML projects and generates two cobertura.xml files at their respective paths.
To display the code coverage result I have used Publish Code Coverage Results task in my build pipeline but it displays the Code coverage for only 1 project and doesn't display the code coverage result of other Html Project.
I tried using two Publish Code Coverage Results task each pointing to different cobertura.xml files but still it displays the code coverage result for only one project on TFS build summary.
Is there any other ways by which I can publish multiple code coverage result?
In our continuous integration process we are using Jenkins, NUnit and OpenCover.
Every Jenkins job runs NUnit and OpenCover, but OpenCover calls the NUnit batch file in order to determine code coverage; therefore NUnit is executed twice.
For example we have a first (simplified) batch:
nunit-console-x86 [PathToTestAssemblies] /xml=NunitResult.xml /noshadow /nodots /process=Separate
And we have a second batch for OpenCover:
OpenCover.Console.exe -target:"NUnit.bat" -output:"./OpenCoverResults.xml" -register -targetdir:".\bin" -coverbytest:*.dll
The problem is that OpenCover does not provide NUnit result (The NunitResult.xml file in my previous command). So in order to have less test time for every Jenkins job we want to get back the NUnit result or find a way to have the following features with OpenCover in the Jenkins job web page:
Latest Tests result from every Jenkins job, so it is easy for a developer to see the latest result.
Test result trend
Is there a way to have both NunitResult and OpenCover results from an single run of NUnit?
I finally found were was the NUnitResult.xml file. In fact it was in the folder were I put all test assemblies (ex: bin) while the Nunit batch put it at the root location.
I think this is because I use the -targetdir args with "bin" to indicate OpenCover were are my assemblies.
We have a Jenkins master hosted by Cloudbees and we are using Sonar-as-a-Service.
We have a regular maven project, and we are using the Sonar "Post Build Action" to successfully collect code coverage. I see the code coverage % in Sonar. Everything works fine.
My question is this: If I examine the Jenkins workspace of this project, I cannot find the code coverage results. I thought it would be saved in an xml file somewhere in the target directory, but i do not see it. Does sonar save the results in the Jenkins workspace somewhere?
Thanks!
Sonar uses Jacoco by default for test coverage, this one uses a binary file afaik
I have started using Qunit to test my JS code. I am looking into JSCoverage to generate the coverage reports later. We have a CI server (Jenkins) which already do a few things with our PHP code and I was wondering if anyone can comment on how I can integrate the report from my Qunit and JSCoverage into Jenkins
Thanks
Sparsh
QUnit: use QUnit API to generate junit XML files. Here's a sample.
In Post-build Actions for your job you then check Publish JUnit test result report and specify your junit XML files (or their file pattern). Jenkins will then mark builds that have failed tests as unstable and produce a nice trend graph of successful/failing tests.
A few more details, for those actually attempting this:
Putting together QUnit and Jenkins
If you want to run QUnit and publish the results in Jenkins, you'll need to do the following:
Step 1: Getting QUnit to generate an XML file compatible with JUnit.
If you're using Apache Ant, this question explains how to get
QUnit to generate XML.
If not, you can use Grunt and
grunt-qunit-junit, together with grunt-contrib-qunit, to
run your .html tests.
And if you're not into either Ant or Grunt, here is
a script for PhantomJS to run your tests directly and produce
JUnit-style XML.
Step 2: Processing that XML file
This is the easy step - look in "Post-build Actions" for your job in Jenkins, and add the path to the XML file.