How to deal with long-running tests in MSTest

I've got a few tests using the MSTest framework which are very long running. These tests are valuable, and I sometimes run them manually. But when I simply want to run "all tests" I want to exclude them by default. I'm using the Resharper test runner to run tests.

When I mark test test as [Ignored] then I can't run it anymore, not even when directly selected.

How can I approach this in a good way?


I don't know any built-in way how to accomplish that with MSTest. But I see some alternatives:

  1. Use a dedicated MSTest project (e. g. LongRunningTests) → you can run these tests manually on demand, on your CI environment, etc.
  2. Switch over to NUnit and use the Explicit attribute.
  3. Create your own LongRunningTest attribute within MSTest and exclude this category within the UI.
  4. Create another build configuration (e. g. Release, Debug and LoadTest) and work with preprocessor directives:
#if !LoadTest
[Ignored]
#endif
[TestMethod]
public void TestSomething()
{
    // the usual AAA stuff
}