提问人:Shahin ahammed 提问时间:10/14/2023 最后编辑:Daniel MannShahin ahammed 更新时间:10/16/2023 访问量:77
如何解决没有测试匹配给定测试用例筛选器Azure Pipeline的问题?
how to resolve no test matches the given testcase filter azure pipeline?
问:
在交换之前,这些单元测试在 Azure 管道中执行。每次执行后,它都会向我显示这一点。
/TestAdapterPath:“F:\agents04_agent04\r2\a”
2023-10-12T20:10:01.1725408Z 开始测试执行,请稍候...
2023-10-12T20:10:04.1812614Z 共有 3 个测试文件与指定的模式匹配。
2023-10-12T20:10:04.2215572Z 责备:将故障转储实用程序附加到处理 testhost.net472.x86 (19376)。
2023-10-12T20:10:05.5133837Z 没有测试与 F:\agents04_agent04\r2\a\tests\DashboardApp.Deployment.Tests\DashboardApp.Deployment.Tests.dll F:\agents04_agent04\r2\a\tests\FtpLibrary.Tests\FtpLibrary.Tests.dll F:\agents04_agent04\r2\a\tests\Webservices.Deployment.Tests\Deployment.Tests.dll 中的给定测试用例筛选器匹配
2023-10-12T20:10:05.8662311Z 结果文件:F:\agents04_agent04_temp\TestResults\ga-build-vm$_ga-build-vm_2023-10-12_20_10_05.trx
2023-10-12T20:10:05.8907689Z Vstest.console.exe 退出,代码为 0。
2023-10-12T20:10:05.8908174Z **************** 已完成测试执行*********************
2023-10-12T20:10:05.8970097Z 测试结果文件:F:\agents04_agent04_temp\TestResults\ga-build-vm$_ga-build-vm_2023-10-12_20_10_05.trx
2023-10-12T20:10:05.9203010Z 未找到发布“F:\agents04_agent04_temp\TestResults\ga-build-vm$_ga-build-vm_2023-10-12_20_10_05.trx”的结果。
2023-10-12T20:10:06.1745166Z 创建测试运行:1240217
2023-10-12T20:10:06.1747100Z 发布测试结果:0TestCategory=BeforeSwap&TestCategory=prod&TestCategory=WebServices
我尝试更新 MSTest 框架并添加 MSTestAdapter。
答:
没有与给定测试用例筛选器匹配的测试 TestCategory=BeforeSwap&TestCategory=prod&TestCategory=WebServices
根据错误消息,它指示测试类或测试方法中的测试类别不符合在管道任务中设置的测试用例筛选器。
测试用例过滤器中设置的测试类别需要同时满足 BeforeSwap、prod 和 webservice。
从单元测试代码的屏幕截图来看,类别为 BeforeSwap、prod 和 Web API。
您可以尝试将测试用例筛选器更改为以下值:TestCategory=BeforeSwap&TestCategory=prod&TestCategory=WebApi
例如:
- task: VSTest@2
displayName: 'Test Assemblies'
inputs:
testAssemblyVer2: |
**\$(BuildConfiguration)\*test*.dll
!**\obj\**
testFiltercriteria: 'TestCategory=BeforeSwap&TestCategory=prod&TestCategory=WebApi'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
或者,还可以检查测试类别定义中是否存在 WebServices 测试类别,并将其应用于实际的测试类。
评论