在 Team Foundation Server (TFS) 版本上运行单元测试 [英] Running unit tests on Team Foundation Server (TFS) builds

查看:13
本文介绍了在 Team Foundation Server (TFS) 版本上运行单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在给定构建运行时让 Team Foundation Server 运行单元测试的步骤是什么?

What are the steps to get Team Foundation Server running unit tests when a given build runs?

开发人员或系统管理员在首次设置 TFS 服务器以执行此操作时应注意哪些警告/陷阱/解决方法?

What are the caveats / pitfalls / workarounds a dev or sysadmin should be aware of when setting up a TFS server to do this for the first time?

构建期间单元测试问题的常见故障排除步骤有哪些?

What are common troubleshooting steps for unit test problems during builds?

推荐答案

这取决于您运行的 TFS 版本,所以我假设它是 2008 年.

it depends on which version of TFS you are running, so I will assume it is 2008.

首先,您必须在用作构建代理的计算机上安装 Team Edition for Testers,如如何:创建构建定义

Firstly, you must have Team Edition for Testers installed on the computer that will act as your build agent, as stated in How To: Create a Build Definition

有几种方法可以告诉 Team Build 为您的构建运行测试.

There are a couple of ways to tell Team Build to run tests for your build.

  1. 单元测试可以从正在构建的解决方案中定义的测试列表运行.此列表由构建定义引用,并执行所选列表中的所有测试.更多信息这里
  2. 还可以通过定义通配符掩码(即 Test*.dll)来执行通配符测试,该掩码指示 Team Build 运行与掩码匹配的程序集中存在的任何测试.这也是在定义构建定义时完成的.

注意事项:

如果您打算使用通配符方法并希望为您的测试配置启用代码覆盖率,您必须将以下内容添加到您的构建定义文件中以启用它.

If you intend to use the wildcard method and want to enable code coverage for your test configuration, you must add the following to your build definition file to enable it.

<RunConfigFile>$(SolutionRoot)TestRunConfig.testrunconfig</RunConfigFile>

有关更多信息,请参阅我之前的问题 这里

See my previous question on this for more info here

这篇关于在 Team Foundation Server (TFS) 版本上运行单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆