【问题标题】:How to run NUnit test in Visual Studio Team Services如何在 Visual Studio Team Services 中运行 NUnit 测试
【发布时间】:2016-10-20 20:02:38
【问题描述】:

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

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 中有这些任务:

“运行单元测试”任务配置如下:

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

我认为 NUnit 的 dll 已正确复制到 packages 文件夹,因为在“Nuget restore”任务中我可以看到以下内容:

Added package 'NUnit.2.6.4' to folder 'C:\a\1\s\INCASOL.IP\packages'

注意:NUnit 版本是 2.6.4,我使用的是 Hosted Agent

【问题讨论】:

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


    【解决方案1】:

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

    Install-Package NUnitTestAdapter
    

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

    【讨论】:

    • 安装适配器后如何使用Visual Studio运行单个测试?
    • 您可以在构建管道中配置一个任务来运行您的测试
    猜你喜欢
    • 2017-05-30
    • 2016-10-04
    • 1970-01-01
    • 1970-01-01
    • 2017-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多