Display OpenCover results in TFS 2015 build

I created the xml coverage file as part of the CI assembly on the TFS server using the vNext 2015 assembly definition. How do I display the results in the TFS 2015 summary? Either using an xml report or html generated using ReportGenerator.

+5
source share
4 answers

You need to convert the results obtained by OpenCover into a format that can be analyzed by TFS.

One way to do this is to use the NuGet OpenCoverToCoberturaConverter package.

Once you do this, you can use the step of assembling the publication results.

I described the whole process of my blog .

+3
source

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

I created my "training project" to create this as .vsix here: https://github.com/RobertK66/vsts-opencover .

My custom build step uses the nunit3 console to run tests under opencover. I managed to download the OpenCover xml result file in the form of "testrun-attachment" via the REST interface and get the fragments in place to display the final values ​​both on the assembly summary tab and on my own extended "representation of the assembly results".

The basis for this first version was the many examples provided by MS on github: https://github.com/Microsoft/vsts-tasks and https://github.com/Microsoft/vsts-extension-samples

To get a first idea of ​​what places on your TFS web portal you can expand / configure, 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 you get started.

+1
source

These settings are not currently supported. You cannot edit displays in the summary of a new assembly. However, you can customize code coverage analysis .

You can send it to the User Voice website at: http://visualstudio.uservoice.com/forums/121579-visual-studio

0
source

Instead of using the OpenCover extension, it’s very convenient for you to generate the result of code coverage and include it on the assembly summary page as follows:

Select the Visual Studio verification step, check the Shell with code enabled box. enter image description here

Then the result of code coverage is displayed on the assembly summary page: enter image description here

-3
source

Source: https://habr.com/ru/post/1236761/


All Articles