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!