Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code coverage does not work on TFS 2010 build server

We've got a TFS 2010 set-up with a dedicated build server. The build for my solution generating the problems runs fine and it also correctly runs all the associated unit tests. The problem, however, is that there is no code coverage shown (locally it works). I did double check the following things:

  • The build definition being used has "Analyze Test Impact" set to "true"
  • The TestSettings File referenced under Automated Tests/Test Assembly is "Local.testsettings"
  • The "Local.testsettings" file has "Code Coverage" (under Data and Diagnostics) enabled and ...
  • ... "Instrument assemblies in place" is also configured with a re-signing key file (.snk)
  • I also tried changing the path to the key file to a UNC path on the build server as I wasn't sure whether it'd be available from there

Despite all the steps above I cannot get the code coverage working for builds on our TFS. The "Summary" shows that all tests were successfully run, and the next line reads "No Code Coverage Results". The log file generated for the build itself does not even show the word "coverage" anywhere, and I don't understand why I don't at least get an error message to work with.

I've read in some other posts that an installation of at least VS2010 Premium is required ot be installed on the build server, but I've also read that failing to do so would result in an appropriate error message, so I expect that this is not the cause for my problems.

Any ideas or pointers in the right direction are greatly appreciated, thanks in advance

G.

like image 219
Gorgsenegger Avatar asked Feb 22 '23 10:02

Gorgsenegger


1 Answers

You need to install Visual Studio on your build server to be able to collect the code coverage. Read a great article how you can set it up

like image 99
Ewald Hofman Avatar answered Feb 26 '23 10:02

Ewald Hofman