@PengGe-MSFT Here is the requested information, also we use the templates within ADO for our pipelines.
- VS2019 build tools
- from the log
[command]"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" @D:\TFSVSOWork_temp\40874cf1-f644-11eb-99f6-9139f2ce0e48.txt
2021-08-05T23:24:18.3601273Z Microsoft (R) Test Execution Command Line Tool Version 16.8.0
2021-08-05T23:24:18.3602154Z Copyright (c) Microsoft Corporation. All rights reserved.
2021-08-05T23:24:18.3602374Z
2021-08-05T23:24:18.3654269Z vstest.console.exe
2021-08-05T23:24:18.3654908Z "D:\TFSVSOWork\359\b\test\ABC.UnitTests.dll"
2021-08-05T23:24:18.3655160Z /EnableCodeCoverage
2021-08-05T23:24:18.3655342Z /logger:"trx"
2021-08-05T23:24:18.3655529Z /TestAdapterPath:"D:\TFSVSOWork\359\s"
2021-08-05T23:24:18.3656168Z -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.CodeCoverage.UseVerifiableInstrumentation=False
2021-08-05T23:24:18.7960562Z Starting test execution, please wait...
2021-08-05T23:24:20.4977512Z A total of 1 test files matched the specified pattern.
2021-08-05T23:24:22.3022827Z NUnit Adapter 4.0.0.0: Test execution started
2021-08-05T23:24:22.3635705Z Running all tests in D:\TFSVSOWork\359\b\test\ABC.UnitTests.dll
2021-08-05T23:24:37.8190808Z NUnit3TestExecutor discovered 22 of 22 NUnit test cases using Current Discovery mode, Non-Explicit run
Yammel
Your build pipeline references the ‘AppName’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
Your build pipeline references the ‘BuildPlatform’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971
steps:
- task: VSTest@2
displayName: 'VsTest - Build Server - $(AppName) - Unit Test '
inputs:
testAssemblyVer2: |
$(Build.BinariesDirectory)\test*UnitTests*.dll
!$(Build.BinariesDirectory)\test*testadapter.dll
!$(Build.BinariesDirectory)\test*testcentric**
vstestLocationMethod: location
vstestLocation: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow'
runSettingsFile: '$/X/Y/Z/$(AppName)'
runInParallel: false
codeCoverageEnabled: true
otherConsoleOptions: '-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.CodeCoverage.UseVerifiableInstrumentation=False'
testRunTitle: 'Build Server $(AppName) Unit Test / Functional Test'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
publishRunAttachments: false