Azure devops 天蓝德沃斯VSTest@2isn';t找不到正确的test.dll来对其执行测试
我有以下.yml配置来运行自动测试Azure devops 天蓝德沃斯VSTest@2isn';t找不到正确的test.dll来对其执行测试,azure-devops,azure-pipelines,Azure Devops,Azure Pipelines,我有以下.yml配置来运行自动测试 pool: name: Hosted VS2017 demands: - msbuild - visualstudio - vstest steps: - script: set displayName: print all variables - task: NuGetToolInstaller@0 displayName: 'Use NuGet 4.4.1' inputs: versionSpec: 4.4.1
pool:
name: Hosted VS2017
demands:
- msbuild
- visualstudio
- vstest
steps:
- script: set
displayName: print all variables
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.4.1'
inputs:
versionSpec: 4.4.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '**\*.sln'
- task: VSBuild@1
displayName: 'Build solution'
inputs:
solution: '**\*.sln'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: PowerShell@2
displayName: 'Set Sauce Environment Variables'
inputs:
targetType: filePath
filePath: ./setEnvironmentVariables.ps1
arguments: '$env:sauce_userName sauce_accessKey $env:SAUCE_RDC_VODQANATIVEAPPAPIKEY $env:SAUCE_RDC_SauceDemoIosRdcApiKey'
- task: VSTest@2
displayName: 'Run Best Practices Framework'
inputs:
#testSelector: 'testAssemblies'
#testAssemblyVer2: '**/*Selenium3.Nunit.Framework*'
testFiltercriteria: 'TestCategory=BestPractices'
runInParallel: true
codeCoverageEnabled: true
testRunTitle: 'NUnit Automation Framework'
rerunFailedTests: true
rerunFailedThreshold: 10
rerunMaxAttempts: 2
failOnMinTestsNotRun: true
我注意到,在日志中,检查测试的唯一可执行文件位于此文件夹D:\a\1\s\SauceExamples\packages\
中,这是不正确的
因此,我不断收到以下消息NUnit在D:\a\1\s\SauceExamples\packages\
如何制作VSTest@2
是否在正确的.dll中查找自动测试
在本地,该.dll的路径如下所示:
C:\Source\SauceLabs\demo csharp\SauceExamples\Web.Tests\bin\Debug\Selenium3.Nunit.Framework.dll
测试文件格式应类似于testAssemblyVer2:'***test*.dll'
,因此您可以
请尝试以下格式:
testAssemblyVer2:'**\Selenium3.Nunit.Framework.dll'
您看过VSTest任务的文档了吗?文档将向您展示如何更改搜索路径。