TFS2010 : Publish nUnit test results

标签 tfs nunit

我在我的项目文件中创建了自定义构建任务来运行我的 nUnit 测试,使用 XSLT 将它们转换为 MSTest 结果格式,并使用所有适当的参数调用 mstest/publish。构建似乎是成功的,但我在构建报告中没有得到任何测试结果。

PublishNUnitReportToTfs: "C:\Program Files (x86)\MSBuild..\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /publish:"http://TFSBuildServer:8080/tfs/Acme Development" /publishbuild:"ci2.myApp.acme.com_20110526.15" /publishresultsfile:"D:\Builds\2\myApp\ci2.myApp.acme.com\Sources\myApp.Core.nUnit.Tests..\nUnitResultsAsMsTestResults.xml" /teamproject:"myApp" /platform:"AnyCPU" /flavor:"Debug"
Microsoft (R) Test Execution Command Line Tool Version 10.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved. Waiting to publish... The file 'D:\Builds\2\myApp\ci2.myApp.acme.com\Sources\nUnitResultsAsMsTestResults.xml' was created in an earlier version of Visual Studio. This file will be converted, in memory only, to the current format. Publishing results of test run tfssvc@TFSBuildServer 2011-05-26 15:47:54 to http://TFSBuildServer:8080/tfs/Acme Development... ...........Publish completed successfully.

我错过了什么吗?

最佳答案

我找到了!

在运行 Build Quality Indicators 报告并使用报告参数后,我注意到除了“Any CPU”之外还有一个奇怪的平台值“AnyCPU”。然后我检查了TFS仓库数据库,发现我的测试结果正在进入数据库。因此,我将 mstest 调用上的平台标志更改为静态值“Any CPU”,而不是使用 $(Platform) 构建属性并修复了它。

希望这对其他人有帮助。

关于TFS2010 : Publish nUnit test results,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6152784/

相关文章:

visual-studio-2008 - TFS 不允许文件夹重命名,声称有锁

visual-studio - 为什么 UIMap 编码的 UI 测试生成器 "Hang"

git - 如何在Node配置中获取Jenkins中的git标签名称

c# - 关于 NUnit TestFixtureTeardown 属性

visual-studio-2008 - 使用 TFS 自动结帐

.net - 我如何在TFS中自动化分支机构/新团队的建立过程

c# - NUnit Adapter 3.9.0.0 输入字符串截断

c# - 如果一个测试没有失败,则运行所有测试

nunit - 如何使用 nunit 和 moq 进行异常处理?

version-control - TFS 结构 - 多个项目还是单个项目?