Using a Lab Environment for Your Application Lifecycle
You can create and manage lab environments with the Lab Management features of Microsoft Test Manager. A lab environment is a collection of virtual and physical machines, which you can use to develop and test applications. A lab environment can contain multiple roles needed to test multi-tiered applications, such as workstations, web servers, and database servers. In addition, you can use a build-deploy-test workflow with your lab environment to automate the process of building, deploying, and running automated tests on your application.
Visual Studio Ultimate, Visual Studio Premium, Visual Studio Test Professional
You must use a lab environment to gain the following benefits:
Use a test plan to run automated tests − You can run a collection of automated tests, called a test plan, and view the progress using Microsoft Test Manager.
Use a build-deploy-test workflow − You can use a build-deploy-test workflow to test multi-tiered applications automatically. A typical example is a workflow that starts a build, deploys the build files onto the appropriate machines in a lab environment, and then performs automated tests. In addition, you can schedule your workflow to run at specific intervals.
Collect diagnostic data from all machines, even during manual testing − You can collect diagnostic data from multiple machines simultaneously. For example, during a single test run, you can collect IntelliTrace, test impact, and other forms of data from a web server, a database server, and a client.
Automatic test agent installation − Lab Management automatically installs test agents on every machine in your environment.
If you use Lab Management in conjunction with System Center Virtual Machine Manager (SCVMM), you can also get these benefits when you use lab environments:
Quickly reproduce machine configurations − You can store collections of virtual machines that are configured to recreate typical production environments. You can then perform each test run on a new copy of a stored environment.
Reproduce the exact conditions of a bug – When a test run fails, you can store a copy of the state of your lab environment, and access it from your build results or a work item.
Run multiple copies of a lab environment at the same time – You can run multiple copies of your lab environment at the same time without naming conflicts.
Here are examples of common types of lab environments:
There are two types of lab environments that you can create with Visual Studio Lab Management—standard Environments and SCVMM Environments. However, the capabilities of each type of environment are different.
Standard Environments: Standard environments can contain a mix of virtual and physical machines. You can also add virtual machines to a standard environment that are managed by third-party virtualization frameworks. In addition, standard environments do not require additional server resources such as an SCVMM server.
SCVMM environments: SCVMM environments can only contain virtual machines that are managed by SCVMM (System Center Virtual Machine Manager), so the virtual machines in SCVMM environments can only run on the Hyper-V virtualization framework. However, SCVMM environments provide the following automation and management features that are not available in standard environments:
For information on SCVMM, see Virtual Machine Manager.
Environment snapshots: Environment snapshots contain the state of a lab environment, so you can quickly restore a clean environment, or save the state of an environment that has been modified. You can also use a build-deploy-test workflow to automate the process of saving and restoring environment snapshots.
Stored environments: You can store a copy of an SCVMM environment, and then deploy multiple copies of that environment.
Network isolation: Network isolation allows you to simultaneously run multiple identical copies of an SCVMM environment without computer name conflicts.
Virtual machine templates: A virtual machine template is a virtual machine that has had its name and other identifiers removed. When a VM template is deployed in an SCVMM environment, Microsoft Test Manager generates new identifiers. This allows you deploy multiple copies of a virtual machine in the same environment, or multiple environments, and then run the virtual machines simultaneously.
Stored Virtual Machines: A virtual machine that is stored in your Team Project library and includes unique identifiers.
For more information about these features, see Guidance for Creating and Managing SCVMM Environments.
Standard environments and SCVMM environments support many of the same features. However, there are some important differences to consider. The following table compares the features that are available for standard environments and SCVMM environments.
Run manual tests
Run coded UI and other automated tests
File rich bugs using diagnostic adapters
Automatic build-deploy-test workflows
Environment creation and management
Use physical machines in addition to virtual machines
Use third-party virtual machines
Automatically install test agents onto machines in the lab environment
Save and deploy the state of a lab environment using environment snapshots
Create lab environments from VM templates
Connect to the environment using Environment Viewer
Run multiple copies of an environment at the same time using network isolation
Here are some additional concepts that you should be familiar with before you continue:
The area of Microsoft Test Manager where you create and manage lab environments.
Team Project Lab
The collection of lab environments that have been set up so you can connect to them and run their virtual machines.
Team Project Library
An archive of stored virtual machines, templates, and stored lab environments that have been imported into the host group of your team project. You can use the items in your library with SCVMM environments; however, you can’t add them directly to a standard environment. You can’t run the items in your library; instead you use them to deploy a new environment.
A lab environment that has been deployed to your team project lab so that you can connect to it and run its machines.
Configure Lab Management components: Determine the components that you need to configure before you can create, view, or modify lab environments.
Plan your SCVMM environments: Before you create or manage an SCVMM environment, decide whether to use running virtual machines, stored virtual machines, templates, a stored environment, and whether to enable network isolation.
Learn more about network isolation: If you want to run multiple identical copies of a lab environment, including unique identifying information, use an SCVMM environment and enable network isolation.
Create new lab environments: After you configure lab management, you can create standard environments and SCVMM environments, or you can deploy a copy of an SCVMM environment.
Manage your lab environments and virtual machines After you create a lab environment, you can connect to the environment, view the environment, modify the environment, and create environment snapshots. You can then manage your environments, virtual machines, and templates in your Team Project Library.
Run tests in your lab environment: You can run manual and automated tests in your lab environment, using Microsoft Test Manager, the Tcm.exe command line utility, or a build-deploy-test workflow.
Configure automated build, deployment, and testing: Create build-deploy-test workflows to automate the process of creating a build of your application, deploying the build to your lab environment, and running tests on the deployed application.
Fix issues in your lab environment: If you encounter trouble creating or connecting to your lab environment, you might need to repair the environment, or in some configurations, take extra steps to configure the environment.