如何在VisualStudioOnline构建中运行Xunit [英] How To Run Xunit in VisualStudioOnline Build

查看:85
本文介绍了如何在VisualStudioOnline构建中运行Xunit的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在自己的Visual Studio在线帐户中拥有VS2015 RC项目.在这个项目中,测试是使用xunit编写的.

I've VS2015 RC project in my visual studio online account. In this project the tests are written with xunit.

在项目中,我添加了以下nuget包

In the project I've added the following nuget packages

  <package id="xunit" version="2.1.0-beta3-build3029" targetFramework="net46" userInstalled="true" />
  <package id="xunit.abstractions" version="2.0.0" targetFramework="net46" userInstalled="true" />
  <package id="xunit.assert" version="2.1.0-beta3-build3029" targetFramework="net46" userInstalled="true" />
  <package id="xunit.core" version="2.1.0-beta3-build3029" targetFramework="net46" userInstalled="true" />
  <package id="xunit.extensibility.core" version="2.1.0-beta3-build3029" targetFramework="net46" userInstalled="true" />
  <package id="xunit.runner.visualstudio" version="2.1.0-beta3-build1069" targetFramework="net46" userInstalled="true" />

通过此操作,我可以在VisualStudio TestPane中查看并运行测试.

With this I can see and run the Tests in the VisualStudio TestPane .

现在,在联机"配置中,我无法添加VisualStudio测试操作.但似乎它只是在寻找MSTestTests.

Now in the Online configuration I cann add the VisualStudio Test Action. But it seems like it is only looking for MSTestTests.

在日志中,我还可以找到:

In the log i can also find:

警告:使用隔离"模式运行 在运行设置中启用了作为诊断数据适配器的测试.使用 /inIsolation参数来禁止显示此警告.

Warning: Using Isolation mode to run the tests as diagnostic data adapters were enabled in the runsettings. Use the /inIsolation parameter to suppress this warning.

警告: C:\ a \ 7588a0f7 \ CRM \ src \ BoundContextes \ SharedKernel \ SharedKernel.Tests \ bin \ Debug \ SharedKernel.Tests.dll. 确保已安装的测试发现者&执行者,平台和 框架版本设置合适,然后重试.

Warning: No test is available in C:\a\7588a0f7\CRM\src\BoundContextes\SharedKernel\SharedKernel.Tests\bin\Debug\SharedKernel.Tests.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.

在此操作中,我可以看到存在自定义TEst适配器的路径".我假设我必须将其设置为XUnit-TestAdapter之类的东西?但是我找不到我应该在那输入的内容,也找不到从哪里得到的?

In this action I can see that there is a "Path To Custom TEst Adapter". I Asume that I have to set this to something like a XUnit-TestAdapter? But I can't find out what I should enter there Nor where to get this ?

推荐答案

您应将自定义测试适配器的路径"设置为"packages"文件夹的位置.

You should set your Path to Custom Test Adapters to the location of the "packages" folder.

例如,我在我的仓库的根目录中将软件包保留在我的解决方案文件旁边,因此我将路径设置为:

For example I keep my packages next to my Solution file in the root of my repo, so I set my path to:

$(Build.SourcesDirectory)\packages

这篇关于如何在VisualStudioOnline构建中运行Xunit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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