【发布时间】:2020-12-01 17:37:25
【问题描述】:
我有一些 NUnit 测试,并通过 the instructions 运行 Azure 测试计划。测试二进制文件从构建脚本构建,该脚本根据说明将测试 dll 链接到管道设置。所有似乎都适用于以下管道
直到 step 4 of Run the automated tests 失败并出现错误:
No test sources found
和
[error]The slice of type 'Execution' is 'Aborted' because of the error : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct.
测试日志说
Creating run for selected test assemblies with following parameters
SourceFilter: *.dll TestCaseFilter:
我的测试程序集实际上称为MyProject.Test.dll,它是使用这些说明构建的
/p:PackageLocation="$(build.artifactstagingdirectory)\\Test\\"
在运行任何测试的上一步中,工件的下载方式如下:
如果我在 Azure 测试脚本中将 Test run 类型更改为 Test assemblies
我从 Azure 测试计划运行中收到错误提示
但是,可以“发布”新的测试脚本,看起来像这样成功
虽然实际上存在类似的错误,但稍后在下面修复:
[warning]No test assemblies found matching the pattern: **\bin\x64\Release\*Test*.dll.
NUnit 测试在 Visual Studio 中运行良好,构建正常,但我无法触发它们从 Azure Devops 运行,aaargh。那里有两个问题:
- 没有将
dll和config库复制到$(build.artifactstagingdirectory)\\Test\\目录的构建任务。我在构建脚本中添加了“复制文件”任务。
- 完成后,我可以在“下载工件”阶段看到测试库已下载到测试目录
我将发布管道搜索文件夹设置为包含下载工件的路径
现在测试程序集通过“发布”运行
如何使用“测试运行”选项运行它?
还是有错误:
[error]The slice of type 'Execution' is 'Aborted' because of the error : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct
【问题讨论】:
标签: azure-devops automated-tests