简体   繁体   English

TFS 2012生成服务器NUnit异常

[英]TFS 2012 Build Server NUnit Exception

I have a NUnit test project that I'm trying to run on my TFS 2012 Build server. 我有一个要在TFS 2012构建服务器上运行的NUnit测试项目。 I'm getting the following error: 我收到以下错误:

  • Exception System.InvalidOperationException, Exception thrown executing tests 异常System.InvalidOperationException,执行测试时引发异常
  • No test is available in C:\\Builds\\1\\Projects\\NUNIT Test\\bin\\NUnitTestProject.dll C:\\Builds\\1\\Projects\\NUNIT Test\\bin\\NUnitTestProject.dll. C:\\ Builds \\ 1 \\ Projects \\ NUNIT Test \\ bin \\ NUnitTestProject.dll C:\\ Builds \\ 1 \\ Projects \\ NUNIT Test \\ bin \\ NUnitTestProject.dll中没有可用的测试。 Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again. 确保已安装的测试发现程序和执行程序,平台和框架版本设置正确,然后重试。

I Have the NUnit.VisualStudio.TestAdapter 1.1.0.0 installed from NuGet and referenced in the project. 我从NuGet安装了NUnit.VisualStudio.TestAdapter 1.1.0.0,并在项目中对其进行了引用。

I also have set the Version control path to custom assemblies set on the controller, which contains (they basically are a copy of the NuGet package): 我还将版本控制路径设置为控制器上设置的自定义程序集,其中包含(它们基本上是NuGet包的副本):
nunit.core.dll nunit.core.dll程序
nunit.core.interfaces.dll nunit.core.interfaces.dll
nunit.util.dll nunit.util.dll
NUnit.VisualStudio.TestAdapter.dll NUnit.VisualStudio.TestAdapter.dll

For test purposes, I'm only building the NUnit test project. 出于测试目的,我仅构建NUnit测试项目。

My test class is very simple and is the following: 我的测试类非常简单,如下所示:

using NUnit.Framework;

namespace NUnitTestProject
{
    [TestFixture]
    public class MySuperTests
    {
        [Test]
        public void MyFirstUnitTestMethod_ReturnsTrue()
        {
            Assert.IsTrue(true);
        }
    }
}

Is there something I haven't done correctly? 有没有我做不正确的事情?

Edit 1: Using TFS 2012 Update 4 on my build server 编辑1:在我的构建服务器上使用TFS 2012 Update 4

Edit 2: The problem I believe lies in the 1.1.0.X version. 编辑2:我相信问题在于1.1.0.X版本。 Updating to 1.1.0.7 I did not have the exception anymore, however, I did have the tests not found problem. 更新到1.1.0.7,我不再有异常,但是,我确实有未发现测试的问题。

There are some issues going on about that on github https://github.com/nunit/nunit-vs-adapter/ 在github https://github.com/nunit/nunit-vs-adapter/上有一些关于此的问题

Edit 3: The problem has been fixed in 1.1.0.8 of the NUnit test adapter! 编辑3:问题已在NUnit测试适配器的1.1.0.8中修复!

Do you have your test runner set correctly in the build defiintion? 您是否在构建定义中正确设置了测试运行器?

Image shows TFS2013 but 2012 has a different option for 2010 compatability which may be selected. 该图显示了TFS2013,但2012年具有2010年兼容性的其他选项,可以选择。 The Visual Studio Test Runner should support multiple test frameworks, whereas the 2010 compatability one only supports MSTest Visual Studio Test Runner应该支持多个测试框架,而2010兼容性仅支持MSTest。

选择测试运行器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM