我如何 运行 在 Azure Devops 中测试 NUnit 而无需在每个项目中都使用测试适配器?

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

我的团队有很多包含 NUnit 测试(版本 3)的测试项目。我们不使用 Visual Studio 测试 运行ner 并且我们的任何项目中都没有引用测试适配器 (NUnit3TestAdapter)。我们如何在 Azure Devops 构建管道中 运行 我们的测试而不通过所有项目来添加测试适配器引用?

您可以将 nuget 包添加到您的项目中,但不必逐个项目进行。您可以一步添加它。

请看这里: NuGet for solutions with multiple projects

我们通过在 VSTest 任务之前将以下任务添加到管道中解决了该问题:

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