2
votes

So my nunit 2.6 tests run in team city, the results appear in a 'tests' tab. I just select the built in nunit build step, type the name of the file with the tests in "Runs Tests from:" and the name of the category(s) in "NUnit categories include:"

However, If I upgrade my tests and select NUnit3 from the "NUnit runner" drop down things start to go wrong.

After much googling and mucking round for command lines and console runners I can't get this working with the full 'results in a tab' level of compatibility.

There is a lot of advice out there on how to make this work, but the best articles are at least a year old and I'm not at all clear that they apply to 3.5.0

Has anyone got this fully working or is it no longer supported? Can you explain how you managed it?

1

1 Answers

3
votes

NUnit 3.5.0 does work with TeamCity, but it requires that you use the NUnit TeamCity Event Listener Extension. You can install it along with the NUnit Console Runner package or use the NUnit Console Runner with Extensions which includes the TeamCity extension along with other commonly used NUnit extensions.

Once you have the extension, TeamCity should automatically add the --teamcity command line option to the nunit3-console.exe.

Check here more information on the various NUnit Runner NuGet packages and what is included in each.

You add these packages to one of your test projects. That will cause them to be installed in the package directory of your solution root. From there, the built in NUnit 3 step will work, just update the executable location to point to 3.5.0. See the Getting Started With NUnit and TeamCity document. I would use the Case 4, NUnit Build Step.

If you only want to test certain categories, you will need to add your --where clause as an additional command line parameter.