问题描述
我使用构建定义如下设置了我的构建。我使用XUnit和本地我的测试被发现和运行。我测试了glob ** \ * spec * .dll
,它找到我所有的测试dll,生成日志显示这些dll实际上是建的。 p>
>
但是在构建日志中我得到
运行VS测试运行
未找到测试。确保安装的测试
发现器&执行者,平台&框架
版本设置是适当的,然后重试。
这似乎暗示着它试图使用MSTest测试运行器而不是XUnit测试运行器。如何告诉Visual Studio在线版本使用XUnit测试运行器和发现器?
这可能已过期现在,但这是我如何设置和工作 - downvote,让我知道如果它的错误,我会删除这个。
首先,你需要创建一个TFVC团队项目(无关紧要)如果您不再使用它)。
进入 $ / MyTFVC / BuildProcessTemplate / CustomActivities /
从xunit.net检查以下文件:
现在在VS中,单击BUILD,管理构建控制器...选项。选择托管的构建控制器(托管)并单击属性...。
输入您在DLL中检入的路径到版本控制路径自定义程序集字段:
你应该很好。
I've setup my build as below using the build definition. I'm using XUnit and locally my tests are discovered and run. I've tested the glob **\*spec*.dll
and it finds all my test dlls and the build log shows that those dlls are in fact built.
However in the build log I get
Run VS Test Runner
No test found. Make sure that installed test
discoverers & executors, platform & framework
version settings are appropriate and try again.
Which seems to suggest it is trying to use the MSTest test runner instead of the XUnit test runner. How do I tell the build for visual studio online to use the XUnit test runner and discoverer?
This might be out of date now, but this is how I have it setup and working - downvote and let me know if it's wrong and I'll delete this. I got it from a blog post/MSDN page, but I can't locate it any more.
First you need to create a TFVC Team Project (doesn't matter if you don't use it again).
Into $/MyTFVC/BuildProcessTemplate/CustomActivities/
Checking the following files from xunit.net:
Now in VS, click the BUILD, Manage Build Controllers... option. Select the "Hosted Build Controller (Hosted)" and click "Properties...".
Enter the path where you checked in the DLL's into the "Version control path to custom assemblies" field:
You should be good to go.
这篇关于在Visual Studio Online中使用XUnit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!