xUnit测试未出现在tfs上 [英] xUnit tests do not appear on tfs

查看:92
本文介绍了xUnit测试未出现在tfs上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本地测试并工作.但是它在服务器上看不到tfs te,因此无法正常工作. 我在Tfs中看不到xUnit测试,也无法使用它. TFS版本2017

--- 隔离 --- -

解决方案

对于普通项目,您可以在构建管道中直接使用Visual Studio Test任务.

您可以尝试明确指定xunit运行器的路径.如

$(System.DefaultWorkingDirectory)\packages\xunit.runner.visualstudio.2.2.0\build\_common)

Szeki的评论是正确的,xUnit测试运行程序只能在面向.NET 4.5.2或更高版本的程序集中运行,否则无法加载(因此将找不到测试).看看这个问题:在VSTS中运行xunit.net测试

如果使用的是.net core项目,则应使用.net core命令行而不是VStest来运行测试.详细信息请参考以下博客:

locally tests and works. but it does not see the tfs te on the server and it does not work. I can not see the xUnit test in Tfs and I can not work with it. TFS version 2017

--- Solition----

解决方案

For normal project, you could directly use Visual Studio Test task in the build pipeline.

You could try to explicitly specific the path to the xunit runner. Such as

$(System.DefaultWorkingDirectory)\packages\xunit.runner.visualstudio.2.2.0\build\_common)

And Szeki's comment is right, xUnit test runner can only be run in an assembly targeting .NET 4.5.2 or above, otherwise it cannot be loaded (and thus the tests will not be found). Take a look at this question: Running xunit.net tests in VSTS

If you are working with .net core project, you should use .net core command line to run the test instead of VStest. Details info please refer below blog:

这篇关于xUnit测试未出现在tfs上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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