This page describes how to configure a Bamboo MSTest Runner task. The MSTest Runner task runs and parses tests for .NET builds.

Before you begin:

To configure a Bamboo MSTest Runner task:

  1. Navigate to the Tasks configuration tab for the job (this will be the default Job if creating a new plan).
  2. Click the name of an existing MSTest Runner task, or click Add Task and then MSTest Runner to create a new task.
  3. Update the task settings:

Task DescriptionA description of the task, for display in Bamboo.
Disable this taskCheck, or clear, to selectively run this task.
Executable

The MSTest Runner executable that you wish to use for this task (e.g. "Visual Studio 2010"). The executable that you select will become one of the task's capability requirements (and hence, one of the job's requirements). For details, please see Configuring a job's requirements.

Specifically for MSTest, we recommend that the executable be defined with the Visual Studio IDE folder path. Example:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\

This will allow Bamboo to find the necessary resources.

Environment VariablesAny extra environment variables you want to pass to your build. e.g. JAVA_OPTS="-Xmx256m -Xms128m".
ContainerThe test container, i.e. the file that contains the tests you want to run. For example, tests.dll. The value of this field is passed to the MSTest.exe as the /testcontainer parameter. See MSTest.exe Command-Line Options (MSDN).
Test MetadataThe path to the Test Metadata file relative to the working directory. For example, "MyApp\MyApp.vsmdi"
Result FilenameThe file that you want to save the test results to. For example, testResults.trx. The value of this field is passed to the MSTest.exe as the /resultsfile parameter. See MSTest.exe Command-Line Options (MSDN).
Run ConfigurationThe run configuration that you want to use. For example, localtestrun.Testrunconfig. The value of this field is passed to the MSTest.exe as the /runconfig parameter. See MSTest.exe Command-Line Options (MSDN).

  • No labels

5 Comments

  1. Jonathan Eagle

    Is this documentation for Bamboo on premise or the on demand version?

    I am using Bamboo OnDemand and I am unable to enter any information into the Executable box. In fact, this is a drop down item for me.

    I have read documentation Defining a new executable capability but I cannot set them as when I view the agent page, I am greeted with a warning that "Local agents are not supported for Bamboo OnDemand edition" and "Remote agents are not supported for Bamboo OnDemand edition".

    Does that basically mean that Bamboo OnDemand cannot use the MSTest runner tool?

     

    1. NathanA

      Hi,

      The default elastic image provided by Bamboo doesn't contain Visual Studio, which is why MSTest Runner is not available.

      You will need to customise your own elastic image and add Visual Studio for Windows to it.

      Have a look at this page: Creating a custom elastic image for more information.

      Hope that helps.

      1. Jonathan Eagle

        Hi Nathan,

        I am currently running my own AMI, which also has an installation of Visual Studio.

        My question is how to then get MSTest Runner working for the custom image. Even with Visual Studio installed, I can't see how I can define the location of the executable to that MSTest Runner can use it.

        Thanks.

        1. James Dumay

          You will need to add an capability that describes where on the elastic image your mstest.exe resides

          see Configuring elastic agent capabilities

          1. Jonathan Eagle

            Hi James,

            I've looked at that page, but I can't see the required links.

            For an example, on the Elastic Agent configuration page, I can't see an "Add Capablity" button.

            For Reference: Defining a new custom capability