0

I currently have a solution with a number of projects which include Unit Tests. We've got a CI build and a separate Scheduled build and I would like to be able to run Code Coverage on the latter (not the CI).

At the moment we are using Visual Studio 2010 and TFS 2008. None of these can be changed. I've looked around for hours and lots of suggestions mention a Process tab to select in the Build Definition however further investigation shows that the combination of VS/TFS that we have does not have this option.

Another source says to modify some testsettings such that they contain the Code Coverage option (which I have done) and then define the Test Settings file in the build - but I have no idea how to do this (http://www.codewrecks.com/blog/index.php/2010/06/14/running-code-coverage-in-tfs2010-builds/).

I have a testsettings configuration that will run code coverage locally so my issue is that I need the MSBuild TFSBuild.proj file to know which testsettings file to use when running it's tests (through the <RunTest>true</RunTest> option).

Any help on this would be greatly appreciated. I've trawled through the various other proposed solutions but none seem to match this. They either use a better version of TFS, or do something else.

EDIT. I suspect I might be restricted to using an Exec task within the build script and running the Vsperfmon.exe command with some arguments. If this is the case please provide an example because I've no idea how to capture the results from this command and tie them to my Scheduled build.

Thanks all.

Ash
  • 131
  • 5
  • 1
    Doesnt this help ? http://stackoverflow.com/questions/80486/how-do-you-turn-on-code-coverage-in-builds-within-tfs – allen Aug 23 '13 at 11:12
  • That looks very promising! Unfortunately now I'm using that, I still get no Code Coverage results (or at least they aren't showing in the Build Explorer and I cant find a result file anywhere obvious). I get an MSBUILD warning saying no analysis was performed because the specified rule set could not be loaded... Failed to load MinimumRecommendedRules.ruleset (I don't know what this ruleset is but we don't have it anymore if we ever did have it). Any clues how to remove that false dependency? – Ash Aug 23 '13 at 14:32
  • I've managed to remove that error but unfortunately the build is still showing no Code Coverage results. I've added the RunConfigFile to the property group so not sure what else to try. – Ash Aug 27 '13 at 15:05

0 Answers0