TFS 团队构建日志单元测试结果 [英] TFS Team Build Log Unit Test Results

查看:31
本文介绍了TFS 团队构建日志单元测试结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用 TFS 2010 Team Build,它会在构建过程中自动运行我们的单元测试.如果我点击查看日志,我可以看到运行的测试列表和每个测试结果(成功/失败).如果出现Failure,我想看到测试结果输出(这样开发者就可以弄清楚失败的原因是什么).仅在本地运行单元测试是不够的,因为问题可能与环境有关(如果测试由于某些数据、服务器或物理路径而失败).

We're using TFS 2010 Team Build which automatically runs our unit tests during the build process. If I click on View Log, I can see the list of tests run and each test result (Success/Fail). In the event of Failure, I want to see the test result output (so the developer can figure out what the cause of the failure is). Just running the unit test locally isn't enough because the issue could be environmental (if the test is failing because of some data, server, or physical path).

如何更改我的构建过程模板以在日志中包含单元测试的完整结果?

How can I change my build process template to include the full results of the unit test in the log?

来自查看日志页面的 MSTest 命令行:

MSTest command line from View Log page:

e:\Program Files\Common7\IDE\MSTest.exe /nologo /usestderr /testSettings:"E:\Builds\1\1\Sources\Source\TestSettings.testsettings" /searchpathroot:"E:\Builds\1\1\Binaries" /resultsfileroot:"E:\Builds\1\1\TestResults" /testcontainer:"E:\Builds\1\1\Sources\Source\Testing\bin\Release\Testing.dll" /publish:"http://tfs:8080/tfs/Projects" /publishbuild:"vstfs:///Build/Build/196" /teamproject:"Project" /platform:"Any CPU" /flavor:"Release" 

摘要截图

http://imageshack.us/photo/my-images/28/tfsbuild.gif/

以及构建定义配置

http://imageshack.us/photo/my-images/835/builddefinition.gif/

谢谢.

推荐答案

如果您使用默认模板并使用 Microsoft 提供的单元测试框架运行测试,您应该能够在构建详细信息的查看摘要页面.当您单击此链接时,将从数据库下载测试结果并将其放在一个 trx 文件中,该文件将显示在 Visual Studio 的测试窗口中.

If you use the default template and run the test using the unit test framework provided by Microsoft, you should be able to see a link to the published test results on the View Summary page of the build details. When you click at this link, the test results will be downloaded from the database and put together in an trx file that will be displayed in your Test Window in Visual Studio.

更新:在查看日志后发现问题.构建模板被定制为使用另一个工具来构建而不是 MSBuild,因此没有创建每个配置(平台/风格)的摘要节点.这就是构建详细信息视图缺少摘要(包括测试结果)的原因.

UPDATE: The problem was figured out after looking at the logs. The build template was customized to use another tool to build instead of MSBuild, and the summary nodes for each configuration (platform/flavor) were not created as a result. That's why the build details view was missing the summary, including the test results.

这篇关于TFS 团队构建日志单元测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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