Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

There is no way to ignore categories in the engine mode
Amir Kolsky
#1 Posted : Thursday, February 26, 2026 4:04:43 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/5/2021(UTC)
Posts: 12

Unlike what the documentation says.
Remco
#2 Posted : Thursday, February 26, 2026 10:59:47 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,528

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
This is absolutely possible.

Go to NCrunch->Set Engine Mode->Customise Engine Modes

Then choose the engine mode you want to ignore categories in.

On the bottom pane, under 'Settings to be overidden by this engine mode', go to Filters->Tests to execute automatically.

Click the pencil.

Click add condition.

Use 'does not have category', and enter the name of your category. Save all changes.

When this engine mode is active, the engine will not automatically execute tests marked with the specified category.
Amir Kolsky
#3 Posted : Monday, March 2, 2026 12:34:54 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/5/2021(UTC)
Posts: 12

So I have done exactly that. I have the [TestCategory("Playwright")] on both "Tests to execute automatically" and "Tests to execute on this machine" I have "When DoesNotHaveCategory 'Playwright'.
Verified that the Engine mode is 'Run impacted tests automatically, others manually. Ignore Playwright tests.'
None of the Playwright tests are ignore whether the category is on the class or on the method.

In the code it looks like this - [TestCategory("Playwright")]
[TestMethod]
public async Task ConnectButtonDisabledWithDefaultValue_Playwright()
Remco
#4 Posted : Monday, March 2, 2026 3:01:56 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,528

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
Thanks for sending through the bug report. This was very useful!

The report indicates values for the two major settings you're working with under your engine mode:
Tests to execute automatically = 'True'
Tests to execute on this machine = 'DoesNotHaveCategory 'Playright''

It looks like there's a typo in the second setting. The first doesn't seem to be effective at the moment ('True' will just run every test).

I'm wondering if you've also been able to check the Category column in the Tests Window to make sure the category is being correctly applied to the tests in question. There's a bit of complexity around how categories are assigned, especially when inheritance is involved, so this is worth checking. Note that the evaluation for category names in NCrunch's execution plan is not case sensitive, but it does need to be precise (i.e. no trailing or leading spaces, etc).
Amir Kolsky
#5 Posted : Tuesday, March 3, 2026 2:33:03 AM(UTC)
Rank: Member

Groups: Registered
Joined: 4/5/2021(UTC)
Posts: 12

This is strange, as when I look at the filter in the engine mode (both of them) it shows Playwright. In the configuration i did have Playright. So the value in the configuration overrides the engine mode. Got it. I'll try to see if the tests still run. Thank you.
Remco
#6 Posted : Tuesday, March 3, 2026 2:52:35 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,528

Thanks: 1021 times
Was thanked: 1370 time(s) in 1271 post(s)
Sometimes it can be worth experimenting with a small sample solution with minimal complexity to see if you can make the settings work in the way you expect them to. This can also be useful for reporting defective behaviour, as you can just submit the test solution through the NCrunch contact form and I'll be able to use it to reproduce the issue.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download