How to run multiple unit tests in Build-Deploy-Test in TFS 2010?


I have been using the Build-Deploy-Test build workflow for TFS 2010 (see here and have come up against a very annoying limitation.

Here is what I have done:

  • Setup a build to be queued
  • Configured it to restore to a test-ready snapshot
  • Added some deployment steps; in this case starting mongo db

I then came to the step where you configure which tests to run and hit an issue. Firstly you need configure a test plan with some test suites; a test suite consisting of test cases. The problem is that each test case can only be associated with a single unit test.

With having to create a test case per unit test, it means that every time a unit test is added a new test case must be created. Is there any way you can associate many unit tests with a test suite that can be ran in the Build-Deploy-Test build workflow.

One way around this problem is to update your test suite using the tcm.exe testcase /import /syncsuite: command. This command has to be run before test execution begins and a logical place to add it would be into the build template.