Code Coverage Details within TFS - tfs

We are using the Team Foundation Server 2015 and our build task uses Report Generator for generating the Code Coverage view.
Now we are trying to get something similar without any third party libraries.
If I look at the build details, under the section "Code Coverage", I have two charts (Blocks and Lines) and beneath these a link "Download Code Coverage Results". And that's all. If I download the file and open it with Visual Studio I can see the details.
Is there any built-in way to generate a webpage or anything else which shows more details on the TFS itself?

There is no out of box feature for this, you can submit a feature request on VSTS User Voice.

Related

How to publish Code coverage result back to TFS 2013

Scenario:
We're trying to enable code coverage in our TFS and so far the build summary result was successfully displaying code blocks covered as shown in picture below but the problem is every time we click Coverage Results link (arrow down in the picture) it doesn't shown the details of what has been covered and it display error in the browser even the test results In/Out folder have code coverage file in build server.
Setup:
MSTest Settings (Local.testsetting)
Test Run
Build Definition
Test Results
Build Summary:
After clicking Coverage Results:
Question : Why TFS 2013 project collection Coverage Results link (red arrow down) in build summary doesn't display code coverage details of what has been covered even the code coverage file was generated in build server TFS 2010? What do we missed in the settings to make it possible?
You need to
1). open the build definition, go to Process -> 3.Test -> Automated Test -> on the Add/Edit Test Run dialog, set the Options to be "Enable Code Coverage".
2). Select the .testsettings file in the build definition.
You can also to have a check on Ralph Jansen's reply in this question TFS 2013 - No Code Coverage Results
Moreover, also check could you open this code coverage link in web portal.
Update
add related screenshot

TFS Reporting Service Configured, but unable to see required reports in Team Explorer - Reports window

Can any one please suggest how do I enable below standard reports in TFS Reports (Scrum):
1) Status on all iteration (Scrum Template)
2) Burndown and Burnrate (Scrum Template)
TFS Reporting service is configured following below guideline and Scrum Template has been imported.
https://www.visualstudio.com/docs/report/admin/add-reports-to-a-team-project
But what I am able to see is only below four reports and not others:
1) Backlog Overview 2) Release Burndown 3) Sprint Burndown 4) Velocity
How do I get other reports over here that are listed in https://msdn.microsoft.com/en-us/library/dd380706.aspx ? which appears to be standard, out-of-box reports which can be used directly.
This is very well-documented if you simply looked on MSDN. I found all of this information by following a few links from the URL you initially provided.
https://www.visualstudio.com/docs/report/admin/upload-reports
Basically, you use the Team Foundation Power Tools to upload the reports.
If the reports are created for another Work Item Template than the one you use in your project then, you might not be able to use the report directly. You might however be able to get it to work with a little editing if it is just a matter of some fields that have other names.
Through the Team Explorer -> Reports click the Go To Site text link to get to the Reporting Services web page. Here you can click the little triangle for one of the existing reports and choose Edit in Report Builder or create a new one by clicking the Report Builder link in the toolbar. I have found that it is far easier to edit an existing report to accommodate your needs than starting from scratch. Over time you might get the hang of it and be able to create your own reports from scratch.

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:

TFS 2010 server build code coverage not shown in TFS "code coverage" dashboard chart

I am having a problem with the TFS SharePoint portals code coverage chart.
We have a .NET 4 solution that is being developed TDD, as a result we have pretty good code coverage, but as a quality check I want to monitor the code coverage rates as the project progresses.
To this end I have a test configuration (a .testsettings file in the solution) which is configured to instrument our soluton assemblies for code coverage and two team build definitions that use that test definition.
Both team builds (one is a CI trigger, the other a nightly shceduled trigger) work and produce code coverage figures
However despite sheduled team builds with code coverage the dashboard "code coverage" excel report always shows 0% coverage, in fact the excel spreadsheet containing the report does not contain any data. This is rather unexpected!
So my question boils down to what steps have I missed to make code coverage data from team builds show up in the TFS database used by the excel code coverage report?
As a side note the SSRS reports are also showing code coverage from the builds, it just seems to be the Excel spreadsheets that fail to see data.
UPDATE
It seems the problem is the filter "Is Build Verification Run" when this filter is removed I see data.
Specifically in my template (MSF for agile v5.0) the version of "code coverage" had a filter applied restricting output to just the "Other" value. Very odd.
When I am back in the office I'll try creating a new project based on the MSF Agile 5.0 tempate and see if this odd filter setting is part of it, or something I did in the past to this project!
I have verified this by creating a new project from the MSF For Agile Software Developmnet v5.0 template.
This turns out to be what I percieve as a bug in the "MSF For Agile Software Developmnet v5.0" template.
When the project is created the excel spreadhseet used for the "code coverage" chart in the dashboards has a filter on it restricting the data to just items whose origin is "other" this excludes code coverage data from a TFS build which has this value set to "true" in the cube.
Simply clearing the filter or including "true" in it resolves the issue and shows you your TFS build code coverage data.

integrate dotCover with TFS

Is there a tutorial somehwere or can somebody explain how to integrate dotCover with TFS? I want to run dotCover (probably the console runner?) as part of the team build process and would like to generate a report that is integrated in the TFS build report.
Running dotCover itself will be easy enough. Simply add an InvokeProcess activity to the build workflow and call the appropriate command line options. I've got a blog post showing how this is done (calling the VB6 compiler in my example) but it should show you what you need to do.
The hard part will be integrating a report into the TFS build report. All you'll really be able to do is slightly customise the log - see Ewald Hoffmans blog post (and series) on customising the build if you want to do this.

Resources