VSTS unit testing and the .VSMDI

If you have done any serious unit testing with Visual Studio Team System and tried to include these tests in your Team Build you will have come across issues with the .VSMDI. It might drive you crazy until you completeley understand what is going on. Lets see if I can explain the situation with a series of truths.

  1. The .VSMDI file is Test Meta Data
  2. Each Solution can have only one .VSMDI
  3. The .VSMDI stores, amoung other things, test lists created using Test Manager
  4. Test lists are required to execute tests in a Team Build
  5. The .VSMDI must be checked into source control for this to work
  6. VS for Developers does not come with Test Manager
  7. A solution can have multiple .testrunconfig files
  8. The active .testrunconfig is stored in the .VSMDI
  9. When a developers switches to another .testrunconfig it will change the .VSMDI

All these truths together mean that everyone on a team including the Build server sharing one solution (which I see happen a lot) is a pain in the ass.  

So how do you each have your own .testrunconfig without messing up the build server. There are plenty of blogs and forum entries out there complaining of this in one way or another.

From what I can tell there are a couple of things you can do.

  1. Download and use the TFS PowerToys TestToolsTask so you can run tests in a build without test meta data files and test lists. The problem with this is it's more difficult to include only the tests you want executed on the build server. Not impossible but not as easy as using test lists.
  2. Create a solution for the Build Server to use. It can have it's own test run config and test lists .VSMDI ( You still need team suite or VS for testers to create them) of course all the developers should have their own Solutions also. This can have it's own headaches on a large project when many VS Projects make up the solution. As developers add projects to their solution they have to make sure everyone else knows as well as the build server solution.

I hope they address this in a coming release, I'd like it to be more transparent to the developer.