TFS 2013 - No Code Coverage Results

tfs, visual-studio-2013

Solution

I just figured out what the problem was that my Code Coverage weren't been calculated on the buildserver. I figured this out with the helpdesk of Microsoft and it is a small UI bug.

Steps to reproduce: Create a new build definition.

- Go to the process tab of the build definition and select the solution file to build.

- Now expand the "Automated tests" section and expand the "Test Source".

- Expand the "Run settings" and change the "Type of run settings" from "Default" to "CodeCoverageEnabled".

- Save the builddefinition and run your build.

- Examine build results and notice no code coverage is calculated.

To fix this issue use the other ui of the build definition.

- Select the "Automated tests" node.

- Now in that row on the right you will see a button with "...". Hit it and a dialog will be opened.

- Hit "Edit" to edit your test source. You will see that Code coverage is enabled. If not select it.

- Hit Ok and Ok again to close the two dialogs.

- Now save the build definition and run your build again.

Now the code coverage does get calculated!!! The microsoft helpdesk has submitted a bug to the development team and it will be fixed I guess the next release. Small bug but it cost me more then two days to find the bug!

Problem

I have a `TFS 2013` environment setup and I am trying to get `TFSBuild` to gather my code coverage results after a build. The tests are running fine, but no matter what I try, I get a message saying "No Code Coverage Results". I have read about a "Code Coverage Analysis Service", but that is not installed on my servers at all and I can't seem to find it anywhere. I have gone through the process of the builds to make sure I have the "Automated Tests --> Test Source --> Run settings --> Type of run settings" set to `CodeCoverageEnabled`, but no matter what else I try, I can't get the results to get published to the Analysis services database so I can run the `Code Coverage Reports`. I have tried a run settings file, but with no luck, so I have taken that out of the equation. Any help would be greatly appreciated!

Original source