How do I run NUnit tests in Azure Devops without having the test adapter in every project?

2k Views Asked by At

My team has many test projects containing NUnit tests (version 3). We do not use the Visual Studio test runner and we do not have the test adapter (NUnit3TestAdapter) referenced in any of our projects. How can we run our tests in an Azure Devops build pipeline without going through all projects to add the test adapter reference?

2

There are 2 best solutions below

0
NJS On BEST ANSWER

We solved the problem by adding the following task to our pipeline, before the VSTest task:

- task: CmdLine@2 inputs: script: 'nuget install NUnit3TestAdapter'

1
Krzysztof Madej On

You can add nuget package to yor projects, but you don't have to go project by project. You can add it in single step.

Please take a look here: NuGet for solutions with multiple projects