2013-05-15 55 views
0

我已經使用社區TFS構建擴展爲我在TFS 2010中的構建模板添加NUnit測試支持。我創建了我的構建定義,並且我的項目正在構建好。它也顯示我的NUnit測試正在完成,但是當它試圖將* .trx測試結果文件發佈到TFS時,我收到「File Not Found」錯誤?我似乎無法確定它出錯的地方,以及在哪裏做出任何改變。下面的錯誤是:含有NUnit的在TFS 2010中運行NUnit測試,測試運行但獲取錯誤發佈結果

查找文件的測試

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

任何幫助或建議將如果任何人有這個問題之前將不勝感激。

Stephen

回答

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測試現在正在發佈!