.NET Core 1.0 VSTest 的 VSTS 版本警告:没有可用的测试 [英] VSTS build of .NET Core 1.0 VSTest Warning: No test is available

查看:19
本文介绍了.NET Core 1.0 VSTest 的 VSTS 版本警告:没有可用的测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将所有单元测试从 xunit 切换到 mstest,并且在我的本地开发机器上一切正常,但是当我尝试使用 VSTS 中的 CI 构建运行我的测试时,它无法识别任何测试我的测试 dll,说明:

I recently switched all of my unit tests over from xunit to mstest, and on my local dev machine everything works great, but when I try to run my tests using a CI build in VSTS, it doesn't recognize any tests in my test dll, stating:

"警告:没有可用的测试c:vsts_work4s estUnitTestsinRelease et452UnitTests.dll".

"Warning: No test is available in c:vsts_work4s estUnitTestsinRelease et452UnitTests.dll".

我相信我已经准备好所有重要的 project.json 位:

I believe I have all of the important project.json bits in place:

  "testRunner": "mstest",

  "dependencies": {
    "dotnet-test-mstest": "1.0.1-preview",
    "MSTest.TestFramework": "1.0.1-preview"
  }

值得注意的是,我使用的是本地构建代理,但我已经证明我可以使用代理运行的服务帐户登录该构建代理,并且我可以打开 Visual Studio 并以这种方式运行测试.

Of note, I am using an on-premise build agent, but I've proven I can log into that build agent using the service account under which the agent runs, and I can open visual studio and run the tests that way.

此外,虽然可以通过查看上述路径来设计它,但值得注意的是,我正在使用完整的框架.

Also, while one could contrive it by looking at the above path, it is worth explicitly noting that I'm using the full framework.

希望有人已经征服了这个.

Hoping someone out there has already conquered this one.

推荐答案

我想出了如何使用Visual Studio 测试"操作,这要感谢 stackoverflow 帖子

I figured out how to use the "Visual Studio Test" action, thanks to this stackoverflow post

答案唯一缺少的是如何使其在 VSTS 中工作(答案提供了命令行).为了让它在 VSTS 中工作,我将以下字符串放在测试程序集"参数中

The only thing that answer lacks is how to make it work in VSTS (the answer provides the command line). To get it to work in VSTS, I put the following string in the "Test Assembly" parameter

**	est**project.json

然后将其余的命令行参数放在其他控制台选项"框中的高级执行选项"下.

And then put the rest of the command line arguments under "Advanced Execution Options" in the "Other console options" box.

/UseVsixExtensions:true /logger:trx

希望这对下一个试图坚持使用 Visual Studio 工具的人有所帮助.

Hope this helps the next guy who is trying to stick with the visual studio tooling.

这篇关于.NET Core 1.0 VSTest 的 VSTS 版本警告:没有可用的测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆