0

I have used the Community TFS Build Extensions to add NUnit test support to my build template in TFS 2010. I have created my build definition and my project is building fine. It also appears that my NUnit tests are completing however I am getting a "File Not Found" error when it tries to publish the *.trx test results file to TFS? I can't seem to work out where it;s going wrong and where to make any changes. The error is below:

Find files containing nUnit tests

NUnit Running C:\Program Files (x86)\NUnit 2.6.2\bin unit-console.exe /nologo "C:\Builds\1\gd_Chinook\ChinookEF_5_Build_Definition\Binaries\tcg.Chinook.Test.dll" /xml="C:\Builds\1\gd_Chinook\ChinookEF_5_Build_Definition\Binaries\outputxmlfile.xml" /out="outputfile.txt" Processing C:\Builds\1\gd_Chinook\ChinookEF_5_Build_Definition\Binaries\outputxmlfile.xml Running %VS110COMNTOOLS%..\IDE\MSTest.exe /publish:"link to our TFS build removed StackOverflow" /publishresultsfile:"C:\Builds\1\gd_Chinook\ChinookEF_5_Build_Definition\Binaries\outputxmlfile.trx" /publishbuild:"ChinookEF_5_Build_Definition_20130515.9" /teamproject:"gd_Chinook" /platform:"Any CPU" /flavor:"Debug" Error: The system cannot find the file specified. Stack Trace: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at TfsBuildExtensions.Activities.CodeQuality.NUnit.RunProcess(String fullPath, String workingDirectory, String arguments) at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishMSTestResults(String resultTrxFile, String collectionUrl, String buildNumber, String teamProject, String platform, String flavor) at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishTestResultsToTFS(ActivityContext context, String folder) at TfsBuildExtensions.Activities.BaseCodeActivity.Execute(CodeActivityContext context).

Associate Changesets and Work Items Analyzing labels ChinookEF_5_Build_Definition_20130515.6 and ChinookEF_5_Build_Definition_20130515.9. The system cannot find the file specified

Any help or suggestions would be greatly appreciated if anyone has had this problem before.

Stephen

4

1 回答 1

0

我已经为自己的问题制定了解决方案。问题的根源在于使用 VS2012 开发和创建构建定义并发布到 TFS2010。

我收到的错误发生在我的测试结果发布到 TFS 时。以下命令尝试运行并生成错误:错误:系统找不到指定的文件...(帖子中省略了堆栈跟踪):

%VS110COMNTOOLS%\..\IDE\MSTest.exe /publish:"http://artigas:8080/tfs/NorthernDevelopmentTeam" /publishresultsfile:"C:\Builds\1\gd_Chinook\ChinookEF_5_Build_Definition\Binaries\outputxmlfile.trx" /publishbuild:"ChinookEF_5_Build_Definition_20130515.9" /teamproject:"gd_Chinook" /platform:"Any CPU" /flavor:"Debug"

经过一番研究,我注意到它试图从 VS2012 目录而不是 VS2010 目录运行命令行。如果我将 %VS110COMNTOOLS%\ 更改为 %VS100COMNTOOLS%,我可以手动运行命令。

为了解决这个问题,我在构建服务器上安装了 VS2012。我希望避免这种情况,只要您安装 .NET4.5 和其他可依赖项,构建本身就可以正常工作。然而,这确实解决了我的问题,我的 nUnit 测试现在正在发布!

于 2013-05-20T15:04:03.153 回答