Monday, March 7, 2011

TFS 2010 Deployment Items - Prefer DeploymentItem attribute

There are multiple ways to configure deployment items when working with TFS 2010. Lets have a look at them one by one.

Local.testsettings
You can specify the deployment items in the Deployment section of Local.testsettings
Visual studio by default picks up the testsettings while running the tests.
If you are using command line, then you will nedd to pass the /testsetting parameter to mstest
If you are running your tests as part of build process, you need to specify the Local.testsettings in the build definition.

Lab Manager TestSettings
If you are running the test as part of lab process, then the Visual Studio testsetting is not used. You will need to create a test setting in lab manager and the files that are specified should be present on the test controller or be under a shared location.
To use this testsetting, you will have to specify it as part of your test plan or lab build definition.

DeploymentItem Attribute
The best way to make your tests work under all circumstances without making any changes is to use the DeploymentItem attribute on your test class/method.
No matter how you are running your tests, the deployment items will always be copied to the test execution folder.

No comments:

Post a Comment