Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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.

like image 399
Julius Avatar asked Jun 13 '16 11:06

Julius


1 Answers

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. NUnit simply will not run an ignored test, even if you programmatically tell it to do so. Or, to put it differently, NUnit "runs" ignored tests by reporting that they are ignored.

This is actually the definition of "Ignored" in 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. 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.

like image 75
Charlie Avatar answered Sep 18 '22 16:09

Charlie