Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Online CI Nunit Tests not found during build

I have a VSO (f.k.a TFS) Git project that builds and deploys properly but can't find the unit tests in the solution.

This is the message I see...

No test found. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

In my build definition I specify

 - Run tests in test sources matching **\Test*.dll, Target platform: 'X86'

My solution structure is like this

/Tests.Unit.ProjectName/Tests.Unit.ProjectName.csproj
/ProjectName/ProjectName.csproj
like image 686
devfunkd Avatar asked Nov 17 '13 04:11

devfunkd


People also ask

How do I create a NUnit Test in Visual Studio?

To create unit tests that use NUnit: Open the solution that contains the code you want to test. Right-click on the solution in Solution Explorer and choose Add > New Project. Select the NUnit Test Project project template. Click Next, name the project, and then click Create.

How to perform automation testing with C #and NUnit framework?

Automation testing with C# and NUnit framework can be performed by installing the NUnit framework and NUnit test adapter. There are two options for installing the NUnit adapter – using Visual Studio extension or using NuGet Package Manager. In this NUnit testing tutorial, we show you setup using both the options. 1. NuGet Package

Does Visual Studio include the Microsoft unit testing frameworks?

Visual Studio includes the Microsoft unit testing frameworks for both managed and native code. However, Test Explorer can also run any unit test framework that has implemented a Test Explorer adapter. For more information about installing third-party unit test frameworks, see Install third-party unit test frameworks

What is the use of NUnit Visual Studio adapter?

NUnit Visual Studio Adapter is used to execute NUnit tests as it works with all the current editions of Visual Studio. Before we look at the NUnit setup example, we need to setup the development environment (or IDE) for NUnit test case development. You need to follow the below steps for installing Visual Studio 2019 (VS 2019):


2 Answers

Another option is to install the NUnit Test Adapter for VS2012 and VS2013 NuGet package in the unit test project. The build server will find it there. No other changes needed.

like image 194
klings Avatar answered Oct 20 '22 14:10

klings


To run NUnit tests, the build system needs to be told where it can find the 3rd party test runner assemblies. Currently it can't load those from a Git Repository. But... It can load them from a Team Foundation Source Control folder in another Team Project. So simply create an empty project using the standard source control and reference the assemblies from there.

In this doc, you're explained how to configure Team Build to load nUnit tests. The basic thing is that you need to copy the Test Runner assembles and stick them in a TFVC repository. You then need to tell the Build Controller where it can find these assemblies.

The hosted build controller can load these assemblies from any team project within your VSO account, so just create a second project which can store these.

See also:

  • http://walkingthestack.blogspot.com/2013/04/using-nunit-for-your-tests-in-team.html
  • http://www.visualstudio.com/get-started/hosted-build-controller-vs#supplemental_binaries
like image 45
jessehouwing Avatar answered Oct 20 '22 15:10

jessehouwing