c# - 将 1 种测试方法关联到 2 个 azure 测试用例
问题描述
我正在尝试将 1 个测试与 azure 中的几个测试用例相关联。
根据docs.microsoft的屏幕截图,它应该可以工作。他们有测试方法 - MultiplyTest 和 3 个相关的测试用例。
我正在使用 net5.0 和 NUnit 3.13.2。1 个测试方法到 1 个测试用例关联对我来说可以。
但是当我尝试将 1 个测试关联到 2 个测试用例时, 测试运行失败并出现以下错误:
=================================================================
Discovering tests from sources
Using new test platform for test execution
Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper instance will be created
DiscoveryMessage : NUnit Adapter 4.0.0.0: Test discovery starting
DiscoveryMessage : NUnit Adapter 4.0.0.0: Test discovery complete
Number of testcases discovered : 44
Discovered tests 44 from sources
=================================================================
[RunStatistics]This execution slice with id '30', received '2' testcases to execute out of which '0' is discovered.
List of test cases in slice with id: 30
Source: Tests.dll, FullyQualifiedTestName: Tests.Tests.Mailing.ExampleTest.SuccessEmptyTest
Source: Tests.dll, FullyQualifiedTestName: Tests.Tests.Mailing.ExampleTest.SuccessEmptyTest
##[error]ExecutionAndPublish.Run : 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.
at Microsoft.VisualStudio.TestService.VstestAdapter.Execution.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
at Microsoft.VisualStudio.TestService.VstestAdapter.ExecutionAndPublish.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
##[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.
at Microsoft.VisualStudio.TestService.VstestAdapter.Execution.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
at Microsoft.VisualStudio.TestService.VstestAdapter.ExecutionAndPublish.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
Received the command : Stop
TestExecutionHost.ProcessCommand. Stop Command handled
SliceFetch Aborted. Moving to the TestHostEnd phase
Please use this link to analyze the test run : https://dev.azure.com/I_DELETED_THE_LINK
Test run '12774' is in 'Aborted' state with 'Total Tests' : 2 and 'Passed Tests' : 0.
解决方案
推荐阅读
- powershell - 如何在 Azure Devops 部署之前使用 powershell 或任何脚本删除 Azure 应用服务文件夹
- node.js - 使用 Angular 的 Express 功能问题
- json - 从 AWS Athena 或 Presto 中的 Json 中提取
- multilingual - 我如何制作至少有两种语言的多语言 rasa 聊天机器人?
- reactjs - 如何在 ReactJS 中随光标指针移动的组件 Cursor 添加“mousemove”事件侦听器?
- qemu - 如何在 QEMU 上使用带有 Buildroot 的 U-Boot 构建和启动 Linux aarch64?
- python - 如何创建垂直于坐标平面的线
- reactjs - 在 React 中设置数组元素的状态
- c# - 从代码度量结果中排除来自 Scaffolded DbContext 生成的代码
- arrays - 如何在java脚本中添加嵌套的对象数组?