简体   繁体   English

VS中的Mstest Run忽略测试

[英]Mstest Run ignored tests in VS

I have created a number of long running integration tests. 我创建了许多长期运行的集成测试。 They take around 5-10 minutes to complete. 他们大约需要5-10分钟才能完成。 I don't want them to run Everytime the developers run tests from VS as it will take a long time. 我不希望他们运行每次开发人员都从VS运行测试,因为这将花费很长时间。 They are purely ad hoc tests 它们纯粹是临时测试

Is there a way to mark a test as ignored but still allow developers to run it locally if they explicitly select and run the test without removing ignore tag each time? 有没有一种方法可以将测试标记为已忽略,但如果开发人员明确选择并运行测试而无需每次都删除ignore标记,仍然允许其在本地运行它? Also i want these tests to run during overnight build via TFS and MS test runner 我也希望这些测试能够通过TFS和MS测试运行程序在一夜之间进行构建

Suggest you look into using Test Categories . 建议您考虑使用“ 测试类别”

By categorising your long running tests separately, you can choose what to include on test runs, eg 通过对长期运行的测试分别进行分类,您可以选择要在测试运行中包含的内容,例如

[TestMethod]
[TestCategory("Integration")]  
public void MyLongRunningTest()  
{  
    // Test Code
}  

And to run: 并运行:

mstest /testcontainer:TestProject.dll /category:"Integration"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM