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!
Code coverage results are displayed in the Coverage tool window, in the Project tool window, and in the editor after you run at least one configuration with coverage. Results of the code coverage analysis are saved to the coverage folder in the IDE system directory.
Well, just click on Toggle Code Coverage Highlighting under the Tools menu: you will see all the lines covered by tests in green, and all the ones that aren't covered by any tests in red. This will help you speed up your development and find out possible bugs and flaws earlier.
Ctrl+U D commands. You can use this command to run coverage analysis of unit tests from the editor, from the Solution Explorer, or from unit tests sessions.
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.
To fix this issue use the other ui of the build definition.
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!
Do you have a Premium or ultimate visual studio installed on your build machine? Either of those is required to get code coverage results back to TFS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With