【问题标题】:Automated tests on TFS 2010 using a test assembly file specification使用测试程序集文件规范对 TFS 2010 进行自动化测试
【发布时间】:2011-10-24 08:34:33
【问题描述】:

我正在使用 TFS,它工作正常。现在我想添加测试和代码覆盖率。所以我创建了一个Local.testsettings。在我的电脑上运行测试运行良好。

TFS Build 的配置如下: - 使用测试程序集文件规范和相同的测试设置文件进行自动化测试(推荐,而不是使用 .vsmdi 文件)

使用 TFS 启动构建时,我的测试没有被执行:

为测试程序集运行 MSTest 在没有 Platform 或 Flavor 值的情况下调用了 MSTestActivity。使用了 Mixed Platforms 和 Debug 值。 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe /nologo /usestderr /testSettings:"C:\Builds\1\MyProject\Sources\MyProject\Main\Source\MyProject\Local. testsettings" /searchpathroot:"C:\Builds\1\MyProject\Binaries" /resultsfileroot:"C:\Builds\1\MyProject\TestResults" /testcontainer:"C:\Builds\1\MyProject\Binaries\MyProject.Tests .Module1.dll" /maxpriority:"1" /minpriority:"1" /publish:"http://tfsserver:8080/tfs/Test" /publishbuild:"vstfs:///Build/Build/433" /teamproject :"MyProject" /platform:"混合平台" /flavor:"Debug" 正在加载 C:\Builds\1\MyProject\Sources\MyProject\Main\Source\MyProject\Local.testsettings... 正在加载 C:\Builds\1\MyProject\Binaries\MyProject.Tests.Module1.dll... 开始执行... 没有要执行的测试。 没有要发布的结果。

所以它找到了程序集,但 MSTest 实际上并没有运行测试。 欢迎任何提示。

【问题讨论】:

  • 这是什么类型的测试?
  • 使用 Microsoft.VisualStudio.QualityTools.UnitTestFramework 的简单单元测试。

标签: unit-testing


【解决方案1】:

看看这个:

 /maxpriority:"1" /minpriority:"1"

看起来您的优先标准可能是问题所在。

【讨论】:

  • 我设置了maxpriority = 2和minpriority = 1,没有任何影响。
  • 尝试将 maxpriority 设置为 maxint(应该是默认值),或者只清除构建定义的过程参数中的两个字段。
猜你喜欢
  • 1970-01-01
  • 2023-03-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-13
  • 1970-01-01
  • 2021-10-11
  • 1970-01-01
相关资源
最近更新 更多