2016-03-02 58 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.