测试类别不会过滤测试并运行过滤后的测试

时间:2016-05-22 10:32:07

标签: c# tfs msbuild mstest tfsbuild

我按照以下链接以分布式方式运行自动化测试(所有测试都是MSTest)。但在这种情况下,测试套件是一个非常大的集合。它有超过4000个测试,执行需要更多时间。因此,我所做的是添加了测试类别并过滤了测试。 我现在有四个类别。让我们称他们为A,B,C,D

我这里有2个问题。

我的问题1: 当我在TFS中应用下面附带的测试过滤条件时,

enter image description here

我无法进行任何测试。以下是日志消息

2016-05-22T06:15:13.2782759Z Executing the powershell script: C:\Users\Devadmin\Downloads\agent\tasks\RunVisualStudioTestsusingTestAgent\1.0.36\RunDistributedTests.ps1
2016-05-22T06:15:13.7157792Z DistributedTests: Environment WinRm Protocol HTTPS.
2016-05-22T06:15:13.7157792Z DistributedTests: Run Settings File Path : c:\BuildAgent\6\s\UITestSettings.testsettings
2016-05-22T06:15:14.1650306Z DistributedTests: Creating run for selected test assemblies with following parameters
2016-05-22T06:15:14.1650306Z DistributedTests: SourceFilter: **\*UITest*.dll TestCaseFilter: TestCategory=MyTests
2016-05-22T06:15:14.1650306Z DistributedTests: Run title: TestRun Dev Build (Automation)_2314422.17
2016-05-22T06:15:14.1650306Z DistributedTests: is automated: True
2016-05-22T06:15:14.1650306Z DistributedTests: test settings id : 588
2016-05-22T06:15:14.1650306Z DistributedTests: build location: C:\Users\Timothy.Alex\AppData\Local\Temp\UITest
2016-05-22T06:15:14.1650306Z DistributedTests: build id: 1351
2016-05-22T06:15:14.1650306Z DistributedTests: test configuration mapping: 
2016-05-22T06:15:14.3369186Z DistributedTests: Test Run with Id 1674 Queued
2016-05-22T06:15:14.4090887Z DistributedTests: Test run '1674' is in 'InProgress' state.
2016-05-22T06:15:24.4579403Z DistributedTests: Test run '1674' is in 'InProgress' state.
2016-05-22T06:15:34.5147956Z DistributedTests: Test run '1674' is in 'InProgress' state.
2016-05-22T06:15:44.5506966Z DistributedTests: Test run '1674' is in 'InProgress' state.
2016-05-22T06:15:54.5948044Z DistributedTests: Test run '1674' is in 'InProgress' state.
2016-05-22T06:16:04.6407774Z DistributedTests: Test run '1674' is in 'Aborted' state.
2016-05-22T06:16:14.6563930Z ##[warning]DistributedTests: Test run is aborted. Logging details of the run logs.
2016-05-22T06:16:15.1940716Z ##[warning]DistributedTests: New test run created.
2016-05-22T06:16:15.1942838Z ##[warning]Test Run queued for Project Collection Build Service 
2016-05-22T06:16:15.1942838Z ##[warning]DistributedTests: Test discovery started.
2016-05-22T06:16:15.1942838Z ##[warning]DistributedTests: Test Run Discovery Aborted . Test run id : 1674
2016-05-22T06:16:15.1942838Z ##[warning]DistributedTests: UnExpected error occured during test execution. Try again.
2016-05-22T06:16:15.1942838Z ##[warning]DistributedTests: Error : No tests were discovered from the specified test sources
2016-05-22T06:16:15.1942838Z ##[warning]DistributedTests: Test run aborted. Test run id: 1674
2016-05-22T06:16:15.2099252Z ##[error]The test run was aborted, failing the task.    

1 个答案:

答案 0 :(得分:0)

错误日志表示"未从指定的测试源发现任何测试",您需要检查步骤" Visual Studio Test using Test Agent Task"中的设置,并确保此步骤之前是“Visual Studio测试代理部署”任务。