首页 > 解决方案 > 将 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.

标签: c#azuretestingautomated-testsnunit

解决方案


推荐阅读