共用方式為


VSTest@1 - Visual Studio Test v1 task

Use this task to run tests with Visual Studio test runner.

Inputs

testAssembly - Test Assembly
string. Required. Default value: **\*test*.dll;-:**\obj\**.

Specifies which test binaries to run tests on. Wildcards can be used. For example, using **\*test*.dll;-:**\obj\** for all DLLs with "test" in the name and excluding files in any subdirectory named "obj".


testFiltercriteria - Test Filter criteria
string.

Specifies additional criteria to filter tests from test assemblies. For example: Priority=1|Name=MyTestMethod.


runSettingsFile - Run Settings File
string.

Specifies the path to the runsettings file to use with the tests. Use $(Build.SourcesDirectory) to access the Project folder.


overrideTestrunParameters - Override TestRun Parameters
string.

Override parameters defined in the TestRunParameters section of the runsettings file. For example: AppURL=$(DeployURL);Port=8080.


codeCoverageEnabled - Code Coverage Enabled
boolean. Default value: False.

Collects code coverage information from the test run.


runInParallel - Run In Parallel
boolean. Default value: false.

Enables a parallel execution of your tests.


vstestLocationMethod - VSTest
string. Allowed values: version, location (Specify Location). Default value: version.


vsTestVersion - VSTest version
string. Optional. Use when vstestLocationMethod = version. Allowed values: latest, 14.0 (Visual Studio 2015), 12.0 (Visual Studio 2013). Default value: 14.0.

Specifies the version of Visual Studio Test to use.


vstestLocation - Path to vstest.console.exe
string. Optional. Use when vstestLocationMethod = location.

Specifies the path to VSTest.


pathtoCustomTestAdapters - Path to Custom Test Adapters
string.

Specifies the directory path to the custom test adapters. NuGet restored adapters are automatically searched for.


otherConsoleOptions - Other console options
string.

Specifies other Console options that can be passed to vstest.console.exe.


testRunTitle - Test Run Title
string.

Specifies a name for the test run.


platform - Platform
string.

Specifies the platform against which the tests should be reported. If you have defined a variable for the platform in your build task, use that when providing this input.


configuration - Configuration
string.

Specifies the configuration against which the tests should be reported. If you have defined a variable for configuration in your build task, use that when providing this input.


publishRunAttachments - Upload Test Attachments
boolean. Default value: true.

Opts in or out of publishing test run level attachments.


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.

Requirements

Requirement Description
Pipeline types YAML, Classic build, Classic release
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: vstest
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.89.0 or greater
Task category Test