Build/Test Issues

An option to disable parallel execution by NUnit categories?

Started by mortan on 9,726 views

Hi!

I'm aware that you can disable parallel test execution via the [NCrunch.Framework.ExclusivelyUses] attribute but I want to avoid using it (multi developer project, not everyone is using NCrunch, checking in the Ncrunch.Framework.dll isn't great either).

Is there really no way to have parallel test execution as default for unit tests but run the tests marked with a specific NUnit attribute (like [Category("Integration Tests")]) in non-parallel mode?

Sorry if I didn't see the obvious setting! :o

Regards!
Hi mortan,

I'm sorry for just jumping in. You don't need to reference the NCrunch.Framework.dll.

Instead you can create your own attribute(s) (having the same names) and place it in that specific NCrunch.Framework namespace. We are doing this approach as well on our side as we also cannot reference the NCrunch.Framework.dll.

BR,
Ralf
Ralf is correct. The only way to selectively use parallel execution is by declaring attributes (at assembly, fixture or test level) to restrict test execution. This means you will need to use ExclusivelyUsesAttribute. Declaring it in your own code is an approach taken by many users as you then won't need a reference to NCrunch.Framework. You can find the declaration/code for this attribute here.

Post a reply

Log in to reply.