This extension provides the following Build / Release tasks:
Inject VSTS Variables Into Runsettings
This task lets you specify an MSTest .runsettings file and injects the VSTS build / release-time built-in variables
into the file as parameters so that they can be made available to your unit / functional tests. This mimics the
similar functionality found in TFS 2012 / 2013 in the Test Lab that would inject the Test Configuration and other
TFS settings into your automated functional tests. Many people are unaware of that feature in those versions of
TFS, which made it possible to configure your test environments entirely within Microsoft Test Manager. We think
that should be brought forward to VSTS.
How to use this Build / Release step:
Select a product for which you want to execute automated unit / functional tests
Create a Build for the product, which must include a .runsettings file to be passed to the Test / Functional Tests
steps in your Build.
Before executing the tests / copying files to the Test Agent steps, insert an "Inject VSTS Variables Into Runsettings"
step into your build.
In the settings for the "Inject VSTS Variables Into Runsettings" step, pass in the Build agent file system path
to the .runsettings file to be updated with the VSTS Variables. See Use Build Variables and
Pre-defined Release Variables
The VSTS build / release variables will now be available to your MSTest unit / functional tests as Properties available
on the TestContext.Properties property for your tests. See TestContext MSDN Documentation
and Using TestContext in Unit Tests
Set Data-driven Test Data Source Table Names
This task lets you specify a .NET .config file containing MSTest data-driven test Data Sources
and update the table name to be used by the data sources. This is useful for the following scenarios:
Mapping each environment of your application to a table in the data source and then selecting which
environment to run against for your tests during a build / release.
Storing your test data in a database and mapping each test case to its own table in the same database.
Select the .config file to be updated (will typically be the .dll.config file created from an app.config for your test assembly), e.g. MyTestAssembly.dll.config where MyTestAssembly.dll contains your test methods.
Enter the name of the data source table you want the tests to use (e.g. Development, Production)