2016-03-02 41 views
0

我正在使用NUnit 3.0 beta來測試Jenkins。它在我的本地項目運作良好,但是當我把它詹金斯系統上,我得到了XML導致像下面來自NUnit3 beta的錯誤

<test-results name="" total="0" errors="0" failures="0" not-run="0" inconclusive="0" ignored="0" skipped="0" invalid="0" date="2016-03-02" time="15:54:20"> 
<environment nunit-version="1.0.0.0" clr-version="4.0" os-version="Microsoft Windows NT" platform="Win32NT" cwd="M:\Works" machine-name="test" user="admin" user-domain="test"/> 
<culture-info current-culture="en-US" current-uiculture="en-US"/> 
<test-suite type="Assembly" name="EndpointBaseFramework.dll" executed="False" result="Success"> 
<properties> 
<property name="_SKIPREASON" value="Constructor on type 'NUnit.Framework.Api.FrameworkController' not found."/> 
</properties> 
<reason> 
<message> 
<![CDATA[ 
Constructor on type 'NUnit.Framework.Api.FrameworkController' not found. 
]]> 
</message> 
</reason> 
<results/> 
</test-suite> 
</test-results> 

什麼是這個錯誤的原因是什麼?

回答

0

NUnit 3已經發布了大約6個月。你確定你正在使用beta版而不是3.0.1嗎?

Jenkins的NUnit插件在June 2015的最後一次更新中,早在NUnit 3發佈之前,源代碼尚未在10 months中更新。 NUnit 3是一個重寫,你不能使用舊的NUnit 2轉輪來運行它。

在插件更新爲支持NUnit 3之前,您需要使用NUnit3 Console Runner運行測試。我會將NUnit.Console NuGet軟件包添加到您的解決方案中。這會將nunit3-console.exe拖入你的軟件包目錄。從那裏,在Jenkins中創建一個後期構建步驟,以在您的測試程序集上執行nunit3-console.exe。見NUnit Documentation for command line options.