从 TFS2008 Team Build 运行 VS2010 UnitTests 项目 [英] Running VS2010 UnitTests project from TFS2008 Team Build

查看:19
本文介绍了从 TFS2008 Team Build 运行 VS2010 UnitTests 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含单元测试项目的 Visual Studio 2010 MVC 3 应用程序.我有一个 TFS 2008 构建定义来构建解决方案.

I have a Visual Studio 2010 MVC 3 application with unit tests projects in it. I have a TFS 2008 build definition to build the solution.

在构建代理上,我安装了以下内容

On the build agent i have got following installed

但是当我运行构建时出现以下错误:-

But when i run the build I get the following error:-

Using "TestToolsTask" task from assembly "c:Program FilesMicrosoft Visual Studio 10.0Common7IDEPrivateAssembliesMicrosoft.TeamFoundation.Build.ProcessComponents.dll".
    Task "TestToolsTask"
      C:Program FilesMicrosoft Visual Studio 10.0Common7IDEMSTest.exe /nologo /usestderr /searchpathroot:"c:TFSCoreCrimeBinariesRelease" /resultsfileroot:"c:TFSCoreCrimeTestResults" /testcontainer:"c:TFSCoreCrimeBinariesRelease\Project1.UnitTests.dll" /testcontainer:"c:TFSCoreCrimeBinariesRelease\Project2.UnitTests.dll" /testcontainer:"c:TFSCoreCrimeBinariesRelease\Project3.UnitTests.dll" /testcontainer:"c:TFSCoreCrimeBinariesRelease\Project4.UnitTests.dll" /publish:"http://server:8080/" /publishbuild:"vstfs:///Build/Build/88124" /teamproject:"Core" /platform:"Any CPU" /flavor:"Release" 
      Invalid switch "/publish".
      Invalid switch "/publishbuild".
      Invalid switch "/teamproject".
      Invalid switch "/platform".
      Invalid switch "/flavor".
      For switch syntax, type "MSTest /help"
    C:Program FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets(1406,5,1406,5): warning : TF270015: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'. 
      The previous error was converted to a warning because the task was called with ContinueOnError=true.
    C:Program FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets(1406,5): warning MSB4018: The "TestToolsTask" task failed unexpectedly. [c:TFSCoreCrimeBuildTypeTFSBuild.proj]
    C:Program FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets(1406,5): warning MSB4018: Microsoft.TeamFoundation.Build.Workflow.Activities.UnexpectedExitCodeException: TF270015: 'MSTest.exe' returned an unexpected exit code. Expected '0'; actual '1'.

如果我通过命令行直接在构建服务器上运行 mstest 命令而没有开关,它工作正常.我不明白为什么它试图添加这些开关.有什么想法吗?

If I run the mstest command directly on the build server via commandline without the switches it works fine. I don't understand why its trying to add these switches. any idea?

推荐答案

您需要安装 VS 2010 Premium 或 Ultimate 才能在 MSTest.exe 中使用这些开关.你可以通过使用你想要的开关执行 MSTest 的 Exec 来解决这种问题,但是你不会在你的构建中很好地看到结果.

You need VS 2010 Premium or Ultimate installed to use those switches in MSTest.exe. You can get around this sort of by just doing an Exec of MSTest with the switches you want, but then you won't see the results as nicely in your build.

这篇关于从 TFS2008 Team Build 运行 VS2010 UnitTests 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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