2014-12-18 90 views
3

我想讓TFS運行我的單元測試。用TFS 2013 NUnit測試

項目組件的名稱是Users.SystemTests.dll。它位於〜/ source/Users.SystemTests/bin/debug中。解決方案文件位於〜/ source/Users.sln中。

我已經在測試程序集項目中包含了Nunit.VisualStudio.TestAdapter nuget包。

enter image description here

構建的結果顯示,測試不運行。

enter image description here

我缺少什麼?他們通過Resharper測試運行器在本地運行良好,我也可以使用nunit-console-x86.exe來運行它們。

這是否與我正在構建解決方案文件的事實有關?也許它的輸出位置是「AsConfigured?」

+0

的可能重複[Visual Studio的在線CI NUnit的構建在測試過程中沒有發現(http://stackoverflow.com/questions/20027235/visual-studio-online-ci -nunit-tests-not-found-build) –

+0

Negative,對這個問題的回答中的建議是使用nuget測試適配器,我提到我正在使用它,但它仍然不起作用。 – Darthg8r

回答

0

好的,我自己跟蹤了這個。它是雙重的。第一個問題是TestAdapter沒有被輸出到bin目錄。另一塊是輸出位置。設置複製本地,然後輸出位置SingleFolder解決了問題。

+0

您應該只需要設置SingleFolder。構建將找到適配器,但單個文件夾確保它也能找到您的測試DLL。 –

0

我確實認爲這是tfs構建中的一個錯誤。它在您使用SingleFolder或PerProject時有效,但不是AsConfigured。在後一種情況下,測試運行器沒有找到測試組件,這對於NUnit和MSTest都是一樣的,所以它不是特定於適配器的。

診斷日誌中說:

Run VS Test Runner00:00:00 
There were no matches for the search pattern C:\a\bin\**\*test*.dll 
There were no matches for the search pattern C:\a\bin\**\*test*.appx