我正在尝试在 VSTS 中创建一个发布管道,该管道运行我在 Test Plan
中指定的 xUnit 测试.
长话短说:我无法让它工作。
我在用什么:
在 Azure DevOps 中,我定义了一个
Test Plan
包含 Test Suite
其中包含一个 Test
有一个 Associated Automation
它指向我的 xUnit 测试。我不得不使用 REST API 将测试代码链接到
Test
如所述 here .我可以选择
Test
在 VSTest 任务的可视化设计器中。当我运行发布管道时,VSTest 任务失败并显示以下错误消息:
DiscoveryMessage : System.IO.FileNotFoundException: Unable to find tests for D:\a\r1\a\Foo.Tests.dll. Make sure test project has a nuget reference of package "Microsoft.NET.Test.Sdk" and framework version settings are appropriate. Rerun with /diag option to diagnose further.
Foo.Tests.dll 的路径是正确的,所有必需的文件也被复制。
.runsettings
中明确指定了框架版本文件(因为选项 Other console options
在使用 Test plan
选项时不起作用)。 path to custom test adapters
Visual Studio 2017
和 Installed by Tools Installer
选项.NET Core Tool installer
安装正确的 .NET Core SDK 错误信息还是一样。
任何想法我可能会错过什么?在这一点上,您的帮助将不胜感激!
最佳答案
几个小时后,我们偶然发现了一个网页,该网页指出您不必复制测试项目的二进制文件作为 VSTest 任务的输入,而是将其发布。没想到是 vstest.console.exe
当您将其指向本地机器上的二进制文件时,运行顺畅。
更新:我们不得不添加一个 Publish Artifact task在我们的 Build Pipeline 结束时,让 Release Pipeline 获取已发布的工件。
关于azure-devops - VSTest-Task 未运行来自测试计划的 .NET Core 2.1 xUnit-Tests,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52588772/