General Feedback

Filter tests with build configuration

Started by Tim__ on 6,584 views

I currently use a customised engine mode to filter tests using a "Manual" test category.

Some of these "Manual" tests are integration tests that I don't want to run automatically, but I would like to run before deployment.

Is there a way to specify that a certain test category should only be run in a given build configuration, i.e. a filter such as [does not have category "Manual"] OR [build configuration is "Release"]?

Edited

Hi,

Thanks for posting!

There isn't anything in NCrunch at the moment that tracks the build configuration selected in VS. NCrunch doesn't make use of this value itself - it instead relies on the default values specified in your project files or the 'Use build configuration' project-level NCrunch configuration setting.

Generally, if you have a set of tests that you only want to run occasionally, there are two ways you can easily do this:
1. Hit the 'run all tests' button on the Tests Window. This will queue ALL tests regardless of whether the engine mode has selected them for automatic execution. There is also an IDE hotkey for this that you can find under the 'NCrunch' menu.
2. Create an engine mode that selects all the tests for automatic execution (or just use 'Run all tests automatically') and change to this engine mode when you want to run all the tests. NCrunch will detect the change and update its processing queue accordingly.

If you need additional features beyond this, you are welcome to request them in uservoice.
Hi Remco,

Thank you for the prompt and detailed reply.

Although your suggestions are useful, I have raised a uservoice feature for the following reasons:

I have 3 categories of test:
(A) Tests to run continuously.
(B) Tests to run before deployment (i.e. in Release Mode).
(C) Tests to only ever run manually.

Running all tests at once would execute the (C) category which I do not want.
Creating a seperate engine mode to run just (A) and (B) would work, but this would require manually changing the engine mode, running the tests, then changing back to the standard engine mode afterwards. These are manual steps I would like to avoid.

Post a reply

Log in to reply.