Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Setting up Bamboo to run MSTests and then display them in the TEST Tab

Righardt Marais June 19, 2012

Bamboo 3.2

I am trying to get our Unit Tests to execute through the Bamboo CI.

I managed to take one of the dll containing the tests and adding that as a single MSTest Runner Task inside a second job as part of my main Plan.

This managed to run and output the MSTest output file (whatever.trx) to the TEST tab.

Problem is that I would now have to create a mstest task for each dll that needs testing (they in different unit test project folders) and then display their results.

Is there a different approach that I can take to running all the tests in one run and displaying them?

Many thanks

Righardt

1 answer

0 votes
James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2012

Hi Righart,

If you want to test multiple dlls using the same MSTest Runner Task, you need to produce a Test Metadata file and specify its location in the task configuration.

The MSTestRunner is just a wrapper around the mstest.exe executable provided by Visual Studio, so its worth reading about mstest.exe and the testmetadata switch.

From the MSTest.exe documentation:

You can use the /testmetadata option to run tests in multiple test containers.

The test metadata file is created for your solution when you create test lists using the Test Manager window. This file contains information about all the tests listed in the Test Manager window. These are all the tests that exist in all test projects in your solution.

You can change the test metadata file only by making changes that are reflected in the Test Manager window, such as creating or deleting tests, or changing a test's properties.

<th align="left">Note</th>

Because the test container contains tests that you can run, you must not specify both the /testcontainer and /testmetadata options in a single command line. Doing this would be ambiguous and would produce an error.

The test metadata file is an XML file that is created in the solution folder. This file is shown in Solution Explorer under the Solution Items node. A test metadata file has the extension .vsmdi, and is associated with the Test Manager window; that is, if you double-click a .vsmdi file in Windows Explorer, the file opens Visual Studio, and its contents. All the tests in a solution's test projects are displayed in the Test Manager window.

When you use the /testmetadata option, it is recommended that you indicate specific tests to run by using the /test option or the /testlistoption, or both.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events