Add AlwaysImpactedAttribute for Run Impacted Tests Automatically mode
It would be useful if there was an AlwaysImpactedAttribute that could be attached to a test method so that it always executes when a code change is made.
The use case I am thinking of occurs with Automapper. We have a test that executes AssertConfigurationIsValid(), but when the engine mode is in "Run Impacted Tests Automatically" NCrunch will not detect that this test needs to be run whenever we make changes to the models in the solution.
If I could put an attribute on that test method that says 'always run', I could continue to use the "impacted only" engine mode but always have the Automapper test be up to date.

-
Thomas Harold commented
For xUnit, that would appear to be:
[Trait("Category", "AlwaysExecuteTest")]
-
Use of the NCrunch Category attribute is only necessary if you're using a test framework that doesn't have its own category attribute equivalent (NCrunch will detect categories of tests via framework integration).
Once you've categorised the test, all your need to do and update the engine mode to set the 'Tests to execute automatically' filter inside this engine mode.
-
Thomas Harold commented
So I would have to:
- Pull the NCrunch Nuget package in
- Add [NCrunch.Framework.Category("AlwaysRun")] to the test method or class
- Configure the engine to always run tests with that categoryhttps://www.ncrunch.net/documentation/V3/reference_runtime-framework_category-attribute
https://www.ncrunch.net/documentation/V3/concepts_engine-modes
-
It's possible to get the engine to do this without needing a new feature.
You can add a special category to tests that use Automapper, then modify the 'Run Impacted Tests Automatically' engine mode to also run tests that are marked with this category, in addition to the impacted tests.