Muokkaa

Jaa


VisualStudioTestPlatformInstaller@1 - Visual Studio test platform installer v1 task

Use this task to acquire the Microsoft test platform from nuget.org or a specified feed, and add it to the tools cache. The installer task satisfies the vstest demand, and a subsequent Visual Studio Test task in a build or release pipeline can run without needing a full Visual Studio install on the agent machine.

Syntax

# Visual Studio test platform installer v1
# Acquire the test platform from nuget.org or the tool cache. Satisfies the ‘vstest’ demand and can be used for running tests and collecting diagnostic data using the Visual Studio Test task.
- task: VisualStudioTestPlatformInstaller@1
  inputs:
  # Package settings
    packageFeedSelector: 'nugetOrg' # 'nugetOrg' | 'customFeed' | 'netShare'. Required. Package Feed. Default: nugetOrg.
    #versionSelector: 'latestPreRelease' # 'latestPreRelease' | 'latestStable' | 'specificVersion'. Required when packageFeedSelector = nugetOrg || packageFeedSelector = customFeed. Version. Default: latestPreRelease.
    #testPlatformVersion: # string. Required when versionSelector = specificVersion. Test Platform Version. 
    #customFeed: # string. Required when packageFeedSelector = customFeed. Package Source. 
    #username: # string. Optional. Use when packageFeedSelector = customFeed. User Name. 
    #password: # string. Optional. Use when packageFeedSelector = customFeed. Password. 
    #netShare: # string. Required when packageFeedSelector = netShare. UNC Path.
# Visual Studio Test Platform Installer v1
# Acquires the test platform from nuget.org or the tools cache. Satisfies the ‘vstest’ demand and can be used for running tests and collecting diagnostic data using the Visual Studio Test task.
- task: VisualStudioTestPlatformInstaller@1
  inputs:
  # Package settings
    packageFeedSelector: 'nugetOrg' # 'nugetOrg' | 'customFeed' | 'netShare'. Required. Package Feed. Default: nugetOrg.
    #versionSelector: 'latestPreRelease' # 'latestPreRelease' | 'latestStable' | 'specificVersion'. Required when packageFeedSelector = nugetOrg || packageFeedSelector = customFeed. Version. Default: latestPreRelease.
    #testPlatformVersion: # string. Required when versionSelector = specificVersion. Test Platform Version. 
    #customFeed: # string. Required when packageFeedSelector = customFeed. Package Source. 
    #username: # string. Optional. Use when packageFeedSelector = customFeed. User Name. 
    #password: # string. Optional. Use when packageFeedSelector = customFeed. Password. 
    #netShare: # string. Required when packageFeedSelector = netShare. UNC Path.

Inputs

packageFeedSelector - Package Feed
string. Required. Allowed values: nugetOrg (Official Nuget), customFeed (Custom Feed), netShare (Network path). Default value: nugetOrg.

Specifies the feed where the task fetches the Visual Studio Test Platform NuGet package.

nugetOrg - Official NuGet: Acquires the test platform package from NuGet. This option requires internet connectivity on the agent machine.

customFeed - Custom feed: Acquires the test platform package from a custom feed or a package management feed in Azure DevOps or TFS.

netShare - Network path: Installs the test platform from a network share. The specified Microsoft.TestPlatform.nupkg version must be downloaded from NuGet and placed on a network share that the build/release agent can access.


versionSelector - Version
string. Required when packageFeedSelector = nugetOrg || packageFeedSelector = customFeed. Allowed values: latestPreRelease (Latest (Includes Pre-Release)), latestStable (Latest Stable), specificVersion (Specific Version). Default value: latestPreRelease.

Installs the latest version or a specific version of the Visual Studio Test Platform. If you use the test platform installer to run Coded UI tests, the chosen Visual Studio Test Platform must match the major version of the Visual Studio installation that built the test binaries. For example, if the Coded UI test project was built using Visual Studio 2017 (version 15.x), you must use Test Platform version 15.x.


testPlatformVersion - Test Platform Version
string. Required when versionSelector = specificVersion.

Specifies the version of Visual Studio Test Platform to install on the agent. Available versions can be viewed on NuGet.


customFeed - Package Source
string. Required when packageFeedSelector = customFeed.

Specifies the URL of a custom feed or a package management feed in Azure DevOps or TFS that contains the test platform package. Public and private feeds can be specified.


username - User Name
string. Optional. Use when packageFeedSelector = customFeed.

Specifies the user name to authenticate the feed specified in the Package Source argument. This input is not required if the password input uses a personal access token (PAT).


password - Password
string. Optional. Use when packageFeedSelector = customFeed.

Specifies the password or personal access token (PAT) for authenticating the feed specified in the customFeed input.


netShare - UNC Path
string. Required when packageFeedSelector = netShare.

Specifies the full UNC path to the Microsoft.TestPlatform.nupkg file. The specified Microsoft.TestPlatform.nupkg version must be downloaded from NuGet and placed on a network share that the build/release agent can access.


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Note

If you are using a hosted agent, check the software table for the agent you are using to see if Visual Studio is installed. If Visual Studio is installed, you don't need to run the Visual Studio test platform installer task.

Use this task to acquire the Microsoft test platform from nuget.org or a specified feed, and add it to the tools cache. The installer task satisfies the vstest demand, and a subsequent Visual Studio Test task in a build or release pipeline can run without needing a full Visual Studio install on the agent machine.

Note

  • The Visual Studio Test Platform Installer task must appear before the Visual Studio Test task in the build or release pipeline.
  • The Test platform version option in the Visual Studio Test task must be set to Installed by Tools Installer.

See Run automated tests from test plans.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities Running this task satisfies the following demands for any subsequent tasks in the same job: VsTest
Command restrictions Any
Settable variables Any
Agent version 2.144.0 or greater
Task category Tool
Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities Running this task satisfies the following demands for any subsequent tasks in the same job: VsTest
Command restrictions Any
Settable variables Any
Agent version 2.103.0 or greater
Task category Tool