RN_
RN_

Reputation: 898

Getting NUnit tests to run on Visual Studio Team Services (Mac Build agent)

I can't seem to get NUnit tests to run on our Mac build agent using VSTS

Here are the build steps I am using in VSTS:

enter image description here

Note, Test assemblies is disabled because the Mac build agent does not have VSTest.exe. In the options menu, there is no way to completely remove the need for VSTest so I cannot use that step on the mac build agent.

Is there a way to run NUnit tests in the MSBuild step?

Things I have tried:

As a last resort, I can add a shell script to run nunit-console on the mac build agent, but I would prefer to avoid that. The reason the build agent needs mac os x is because we're building an iOS and Android app with Xamarin.

Screenshot of the references and NuGet packages in VS:

2

Build output:

enter image description here

Test assemblies are created, but I can't get them to run

Upvotes: 7

Views: 1385

Answers (1)

Eddie Chen - MSFT
Eddie Chen - MSFT

Reputation: 29976

The instruction for how to use MSBuild tasks for NUnit can be found here: NUnit3 or NUnit. You need to update your project file to import the tasks according to this: Get Started and then add the NUnit MSBuild tasks into your project file. And you can also add an Exec Task in your project file to call NUnit console to run the NUnit test.

Upvotes: 1

Related Questions