简体   繁体   English

在VS2015中的Resharper 2016.1中运行忽略的测试

[英]Run ignored test in Resharper 2016.1 in VS2015

Upgraded Resharper to 2016.1 and I'm not able to run NUnit tests marked with the Ignore attribute. 将Resharper升级到2016.1,我无法运行标有“忽略”属性的NUnit测试。 This was possible before by right clicking the test and run. 通过右键单击测试并运行,可以做到这一点。 Is this a change or am I missing something? 这是变化还是我错过了什么?

It is very frustrating, I have many tests which I ignore on the build machine which I would like to run locally. 这非常令人沮丧,我有很多要在本地运行的构建机器上忽略的测试。

Resharper has been using NUnit itself to run it's tests for a long time, so it seems you must have done a really big upgrade, from an early version of Resharper that executed the test methods itself. Resharper长期以来一直使用NUnit来运行其测试,因此看来您必须从执行该测试方法本身的早期版本的Resharper进行了很大的升级。 NUnit simply will not run an ignored test, even if you programmatically tell it to do so. 即使您以编程方式告诉NUnit,NUnit也不会运行被忽略的测试。 Or, to put it differently, NUnit "runs" ignored tests by reporting that they are ignored. 或者换句话说,NUnit通过报告被忽略而“运行”被忽略的测试。

This is actually the definition of "Ignored" in NUnit. 这实际上是NUnit中“已忽略”的定义。 It was designed a long time ago to deal with tests that should not be run, generally for a very short period, while the developer is doing other work. 它是很久以前设计的,用于处理不应在开发人员执行其他工作时运行的测试(通常在很短的时间内)。 It shows up as a warning in any test runs because, in the ideal world, Ignored tests should not make it into your CI runs. 它在任何测试运行中均显示为警告,因为在理想情况下,被忽略的测试不应将其纳入CI运行中。 It may be the wrong attribute for you to use for your purposes, especially if you want to be able to run it some of the time. 出于您的目的使用它可能是错误的属性,尤其是如果您希望能够在某些时候运行它。 If you want a test that is only run when expressly selected, we have the "Explicit" attribute instead. 如果您希望仅在明确选择后才运行的测试,则可以使用“显式”属性。 Other behavior is possible, but it would take a feature request. 其他行为也是可能的,但是需要功能请求。

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

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