Display OpenCover results in TFS 2015 build Summary

I have generated my xml coverage file as part of CI build on the TFS server using vNext 2015 build definition. How would one display the results in the TFS 2015 summary ? Either using the xml report or the html generated using the ReportGenerator.


You need to convert the results produced by OpenCover to a format which can be parsed by TFS.

One way to do this would be to use the OpenCoverToCoberturaConverter NuGet package.

Once you have that, you can use the Publish Code Coverage Results build step.

I have described the whole process on my blog.

In “TFS 2015 - Update 2” this is possible by writing your own vsts extension (see here: https://www.visualstudio.com/en-us/docs/integrate/extensions/overview ).

I set up my own 'learning project' for building this as .vsix here: https://github.com/RobertK66/vsts-opencover.

My custom build step uses nunit3 console runner to execute tests under opencover. I managed to upload the OpenCover xml result file as 'testrun-attachment' via REST-interface and got the pieces in place to show the summary values on both the build summary tab and on its own extended “build-results-view”.

Base for this first version were a lot of examples provided by MS on github: https://github.com/Microsoft/vsts-tasks and https://github.com/Microsoft/vsts-extension-samples

To get a first feeling what places on your TFS Web Portal can be extended/customized you can download and install this extension https://aha.gallery.vsassets.io/items?itemName=ms-samples.samples-contributions-guide from the Visual Studio Marketplace.

Hope this helps to get you started.

Currently, these customizations are not supported. You can't edit the displays in new build summary. However, you can customize Code Coverage Analysis.

You can submit it to User Voice site at: http://visualstudio.uservoice.com/forums/121579-visual-studio

Instead of using OpenCover extension, it is very convenience for you to generate code coverage result and include it in the build summary page this way:

Select the Visual Studio Test step, check the Code Coverage Enabled option.

Then, the code coverage result shows on the build summary page:

Need Your Help

Generating documents in multiple applications

.net ms-office openoffice.org indesign

I need to create an application that generates a bunch of templates for Office (2000), OpenOffice.org (2.0) and InDesign. The design of the templates will be made in each application but we need a ...

Strange behaviour of Scala in pattern matching in case of JSON fields (json4s framework)

scala scala-2.10 json4s

I'm trying to traverse JSON and extract information about types of objects in fields: