Dela via


How to: Add Test Controllers to Use for Testing with Lab Management

You can use test controllers with your virtual environment to run automated tests on your virtual environment, collect data and diagnostics when you run manual or automated tests, or to run tests using the workflow capability to build, deploy and test your application.

You can set up a test controller when you configure Lab Management for the first time, or you might want to add another test controller later if you have multiple environments running tests at the same time and you want to distribute the load between multiple test controllers. You select a test controller for your testing capability when you create your virtual environment. For more information about test controllers and environments, see Setting Up Test Machines to Run Tests or Collect Data.

Note

To configure Lab Management for the first time, see Configuring Lab Management for the First Time.

Use the following procedures to install a test controller and verify that it is working correctly.

To install a test controller

To verify that all the communications between the test controllers and agents are working, you must create a virtual machine or a template that has a test agent and a lab agent installed and save this virtual machine into the library share. Then add this virtual machine or template to a virtual environment by using Microsoft Test Manager. When you start this virtual environment, the status of the testing capability is checked by Lab Management. If everything is working correctly, a blue check mark and a status of "Ready" are displayed.

Note

To verify the workflow capability at the same time, follow the steps to install a build agent on the virtual machine in addition to the other agents. You will also need a build controller to test this. For more information, see How to: Add Build Controllers to Use to Deploy Applications with Lab Management.

To install the agents on the virtual machine for an environment

  1. Create a virtual machine and install an operating system.

  2. To verify the testing capability, install the test agent on this virtual machine. For more information about how to install a test agent, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

    Note

    You do not have to register the test agent with a test controller when you install. This will be done automatically when the virtual machine is deployed by Lab Management.

  3. (Optional) To verify the workflow capability, install the build agent on the virtual machine. To add a build agent, you must use the installation DVD for Team Foundation Server. This installation has a selection to install the build service, which will install a build agent. For more information about how to install a build agent, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

  4. Install the lab agent on this virtual machine. For more information about how to install a lab agent, see Installing and Configuring Visual Studio Agents and Test and Build Controllers.

  5. To store the virtual machine so that it can be imported into your team project, right-click the virtual machine and point to Store in library.

    1. Select the SCVMM library share that you added to your team project collection and click Next.

    2. Select the path for the share location for this virtual machine and click Next.

    3. Click Store.

      Note

      You can clone the virtual machine and then store this clone if you still want to be able to start this machine from SCVMM. Also you can create a template from this virtual machine if you plan to create multiple instances of the same virtual machine within an environment. For more information about when to create a template or use a virtual machine, see Creating Virtual Environments.

To verify that the test controller is working with the test agents

  1. Using Microsoft Test Manager, select Lab Center.

  2. To import the virtual machine with the agents that you have installed, click Library, Virtual Machines and Templates, and then click Import.

  3. On the Name and machine wizard page, follow these steps:

    1. Click Browse to display a list of the virtual machines and templates that are available from Virtual Machine Manager.

    2. From the list of virtual machines and templates, select the virtual machine that you created, and then click Add.

    3. Select the role for the virtual machine, and then click Next.

  4. Click Finish to import the virtual machine.

  5. The imported virtual machine should now be displayed in the list and show a status of Stored.

  6. To create a new environment with this machine, click Lab, New, and then click New Virtual Environment.

  7. On the Name and location wizard page, type a name and description for the environment.

  8. To select the host group where your virtual machines for the environment will be deployed, select the host group from Select the location. Then click Next.

  9. On the Machines wizard page, click the virtual machine that you imported earlier, and then click Add to environment. Then click Next.

    This step adds a copy of that virtual machine to the environment being created and the machine is displayed in the selected virtual machines list.

    Note

    To change the role of this virtual machine, click Edit Role.

  10. Click Next.

  11. To run tests on this environment, on the Capabilities wizard page select Run tests on this environment. Then select the test controller that you installed to register the test agents with this test controller when the environment is started.

  12. (Optional) To run workflows on this environment to deploy your application, select Run workflows on this environment. Then select the build controller that you have previously installed to register the build agents with this build controller when the environment is started.

  13. Click Next.

  14. On the Summary wizard page, review all the selected options, and then click Finish.

  15. This starts to create the environment. After the process is complete, you should see an environment in the Off state.

  16. To start the environment, click Start. When the environment has started, click Connect. This displays the Microsoft Environment Viewer application. Log into the virtual machine.

    You should now see the blue check mark for the testing capability and it should have a status of ready in the Environments view for this environment.

    If the status for this capability is correct, you have successfully completed the configuration to enable the testing capability of Lab Management. You can now run tests using your virtual environment. For more information, see Testing Using Virtual Environments.

  17. Close the Environment Viewer.

See Also

Concepts

How to: Add Build Controllers to Use to Deploy Applications with Lab Management

Deploying An Application to a Virtual Environment

Other Resources

Changing Existing Lab Management Configurations