2
votes

I have a NUnit test project that I'm trying to run on my TFS 2012 Build server. I'm getting the following error:

  • Exception System.InvalidOperationException, Exception thrown executing tests
  • No test is available in 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.

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):
nunit.core.dll
nunit.core.interfaces.dll
nunit.util.dll
NUnit.VisualStudio.TestAdapter.dll

For test purposes, I'm only building the NUnit test project.

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

Edit 2: The problem I believe lies in the 1.1.0.X version. Updating to 1.1.0.7 I did not have the exception anymore, however, I did have the tests not found problem.

There are some issues going on about that on 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!

1
Thanks this helped me out. Version 1.2 works fine as well.Christian Maslen

1 Answers

0
votes

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. The Visual Studio Test Runner should support multiple test frameworks, whereas the 2010 compatability one only supports MSTest

Choose Test Runner