【问题标题】:Test category is not filtering the test and getting run the filtered tests测试类别未过滤测试并运行过滤后的测试
【发布时间】:2016-09-19 06:47:47
【问题描述】:

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

我这里有 2 个问题。

我的第 1 期: 当我在 TFS 中应用如下附加的测试过滤条件时,

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

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.    

【问题讨论】:

  • 您点击了哪个链接?如果您不应用测试过滤条件,您能否通过此步骤?
  • 您的测试程序集是否正确复制到构建位置?你能分享一下 testesettings 文件吗?

标签: c# tfs msbuild mstest tfsbuild


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-19
    • 1970-01-01
    • 2017-07-04
    • 1970-01-01
    • 1970-01-01
    • 2020-01-05
    • 2018-01-27
    • 2015-03-04
    相关资源
    最近更新 更多