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

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

问题描述

我最近将所有单元测试从xunit切换到了mstest,在我的本地dev机器上一切正常,但是当我尝试使用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_work\4\s \test\UnitTests\bin\Release\net452\UnitTests.dll。

"Warning: No test is available in c:\vsts_work\4\s\test\UnitTests\bin\Release\net452\UnitTests.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.

推荐答案

由于这个堆栈溢出后的帖子

唯一缺少的答案是如何使其工作在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

**\test\**\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天全站免登陆