TFS 2013 – No Code Coverage Results

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.

  1. Go to the process tab of the build definition and select the solution file to build.
  2. Now expand the “Automated tests” section and expand the “Test Source”.
  3. Expand the “Run settings” and change the “Type of run settings” from “Default” to “CodeCoverageEnabled”.
  4. Save the builddefinition and run your build.
  5. Examine build results and notice no code coverage is calculated.

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

  1. Select the “Automated tests” node.
  2. Now in that row on the right you will see a button with “…”. Hit it and a dialog will be opened.
  3. Hit “Edit” to edit your test source. You will see that Code coverage is enabled. If not select it.
  4. Hit Ok and Ok again to close the two dialogs.
  5. 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!

Leave a Comment