【问题标题】:Team Foundation Server 2015 TestCategory not workingTeam Foundation Server 2015 TestCategory 不工作
【发布时间】:2016-05-19 01:20:07
【问题描述】:

TFS 2015 正在调用没有“开发”测试类别的测试。

TFS 构建具有 Visual Studio 构建和 Visual Studio 测试步骤。测试步骤在测试过滤条件中设置了 TestCategory=Dev。

测试类

[TestMethod]        
[TestCategory("Dev")]
public void AllOrderItems() {
    //Assertions here.....
}

记录结果

2016-05-17T18:11:07.5722452Z ##[debug]Entering script VSTest.ps1
2016-05-17T18:11:07.5732446Z ##[debug]vsTestVersion = 14.0
2016-05-17T18:11:07.5732446Z ##[debug]testAssembly = **\*tests*.dll;-:**\obj\**
2016-05-17T18:11:07.5742465Z ##[debug]testFiltercriteria = TestCategory=Dev
...
2016-05-17T18:11:08.1743177Z Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\TestAgentWork\35\s\APP.Business.Tests\bin\APP.Business.Tests.dll" "C:\TestAgentWork\35\s\APP.Business.Tests\bin\Test\APP.Business.Tests.dll" "C:\TestAgentWork\35\s\APP.Models.Tests\bin\Debug\APP.Models.Tests.dll" "C:\TestAgentWork\35\s\APP.Models.Tests\bin\APP.Models.Tests.dll" "C:\TestAgentWork\35\s\APP.Models.Tests\bin\Test\APP.Models.Tests.dll" "C:\TestAgentWork\35\s\APP.Web.Tests\bin\APP.Web.Tests.dll" "C:\TestAgentWork\35\s\APP.Web.Tests\bin\Test\APP.Web.Tests.dll"  /TestCaseFilter:"TestCategory=Dev" /logger:trx
...
2016-05-17T18:11:10.6976251Z ##[error]Error Message:
2016-05-17T18:11:10.6976251Z ##[error]   Assert.IsTrue failed. 
2016-05-17T18:11:10.6986243Z ##[error]Stack Trace:
2016-05-17T18:11:10.6996235Z ##[error]   at APP.Business.Tests.BusinessLayerTests.CheckIfCertifierSignatureOnFile() in C:\TestAgentWork\35\s\APP.Business.Tests\BusinessLayerTests.cs:line 516
2016-05-17T18:11:10.6996235Z Failed   CheckIfCertifierSignatureOnFile

我也尝试了 priority=1 并将 [Priority(1)] 作为属性添加到测试方法中,结果相同。

TFS 版本 14.95.25122.0

【问题讨论】:

    标签: tfs tfs-2015


    【解决方案1】:

    刚刚使用 TFS 2015 Update2 进行了测试,测试过滤器标准按预期工作。请确保您的 TFS 已升级到最新版本。

    此外,错误消息“Assert.IsTrue failed”表示问题是由于您的测试方法造成的,您可以检查它们。

    【讨论】:

    • 问题是运行的测试不属于该类别。我已经更新了日志输出。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-12
    • 2016-03-09
    • 2017-05-19
    • 2016-09-10
    • 2010-09-23
    • 2011-04-01
    • 1970-01-01
    相关资源
    最近更新 更多