continuous-integration - 如何在 Visual Studio Team Services 中运行 NUnit 测试

标签 continuous-integration nunit azure-devops azure-pipelines-build-task

当我尝试执行 NUnit 在 VSTS 任务中测试我收到以下错误:

Warning: The path 'C:\a\1\s\INCASOL.IP\packages' specified in the 'TestAdapterPath' does not contain any test adapters, provide a valid path and try again.

我在 VSTS 中有这些任务:

enter image description here

“运行单元测试”任务配置如下:
enter image description here

注意我已经设置了“自定义测试适配器的路径”。

我认为 NUnit 的 dll 已正确复制到包文件夹,因为在“Nuget restore”任务中,我可以看到以下内容:
Added package 'NUnit.2.6.4' to folder 'C:\a\1\s\INCASOL.IP\packages'

注意:NUnit 版本是 2.6.4,我使用的是托管代理

最佳答案

在寻找解决方案几个小时后,我在问了我的问题几分钟后解决了它。
虽然我可以使用 NUnit Test Adapter 在本地机器上运行我的测试,但这个包并没有被添加到我的包文件夹中。所以,一旦我跑了

Install-Package NUnitTestAdapter

对于我的测试项目,一切正常。

关于continuous-integration - 如何在 Visual Studio Team Services 中运行 NUnit 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40163527/

相关文章:

c# - NuGet 还原后,MSBuild 在单元测试项目 (.NET Core) 上失败

node.js - 尝试将站点部署到 Azure 时出现应用程序错误

msbuild - Teamcity 坚持使用 "debug"配置进行发布

tfs - 防止在门控 checkin 版本上发布触发器

c# - 如何使用 ExpectedException 属性强制执行异常消息

c# - Assert.True 未通过测试

git - Hudson git 插件不会在 Linux 上克隆 repo

c# - SameAs 断言调用 setter 与 VB.Net

azure - 如何获取 Azure DevOps Artifact 使用者的列表?

tfs - 是否应该为变更集迁移用户名和时间戳?