General Feedback

Ignore categories of tests

Started by Balfa on 13,204 views

With NamedTestSelector and RegexTestSelector, I can ignore a single test or a collection of tests, but I can't see a way to ignore a Category (using the NUnit categories as described at http://www.ncrunch.net/documentation/concepts_test-categories ). I have a category of integration tests called "Database", which I don't want to run all the time, and certainly not when I'm out of the office and without network connection.

I understand that I can create an engine mode so that this category of tests is not run automatically, but I'm really interested in completely ignoring these tests altogether. If they've been run at all, manually, perhaps by accident, while I'm offline, they'll leave the Red Ring of Shame at the bottom of my IDE :(

That more complicated part of this equation might be having ignore presets that I can switch between depending on whether I'm in the office or not. That would be great.

I'm thinking the analogous work flow from the pre-NCrunch days would be that when I'm in the office, I manually run "nunit-console.exe myassembly.dll" frequently, and when I'm out of the office, I manually run "nunit-console.exe myassembly.dll /exclude:Database" frequently.
Hi, thanks for sharing this.

Right now NCrunch doesn't have any ability to set ignore specifiers at category level. This was an intended feature of the V2 release, but it was axed when the complexity went through the roof.

The ignore options DO work at category level inside the Tests Window, although they work by adding fixture-level ignore specifiers inside the config file. The specifiers in the config file are essentially internal to NCrunch, they aren't really intended to be edited manually.

You're welcome to vote for a feature to fill this gap if you like.
I don't fully understand what you mean about the ignore options working at category level. I can't see anything category-related inside the Tests window. How do I add one of these ignores that does work at category level?
Sorry, what I mean is that you can still select the 'Ignore' and 'Unignore' options in the Tests Window when a Category row is selected.

The Tests Window will then apply fixture-level ignores to ALL tests within the category you've selected.

So it isn't possible to apply Category-level ignores. It's just possible to apply Fixture-level ignores in bulk by 'ignoring' a category that contains these tests. This approach is quite limited because any newly categorised tests won't be ignored until you specifically tell NCrunch to ignore them (i.e. they won't automatically inherit the ignore from their category when they come into life).
Ah, I just realised it's probably because I'm still on version 1 that don't see any Category rows (or anything Category-related) in the Tests Window.
Ahh - that would make sense. In that case, I highly recommend the upgrade :)
Maybe this will be the killer feature I need to justify upgrading ;)

https://ncrunch.uservoice.com/forums/245203-feature-requests/suggestions/6068948-ignore-categories-of-tests

Thanks for your answers.

Post a reply

Log in to reply.