Feature Suggestions

Add project-level setting for running tests in parallel/sequential.

Started by GreenMoose on 8,082 views

Suppose I have 1 test project with integration tests communicating with a database which I do not want to run in parallel due to deadlocks etc. And X other test projects that I do want to run in parallel.

I would then appreciate a project-specific setting that forces NCrunch to run tests in that project sequentially. (Another option would be to use some framework-specific category etc. but I guess the most compatible way is using a setting on project level?)

Keep up the good work.
Hi, thanks for the suggestion!

I'm wondering if the best way to implement this may be to make some of the NCrunch.Framework attributes work at assembly level.

For example, you could then apply an attribute to the test assembly in the form:

[assembly: NCrunch.Framework.Serial]

And this would solve the problem clearly and cleanly What are you thoughts?

Edited

Problem with that solution is that we then need NCrunch to get project compiled (including on integration server, devs not running NCrunch etc.) which I don't think is a good option unfortunately.
There is a way around this.

All the attributes that are defined in NCrunch.Framework.dll are basically just named shells, they aren't statically linked with the NCrunch code.

NCrunch identifies the meaning of these attributes by their name. So if you create new attributes of your own that specify the same name and namespace, declared inside your test project, then NCrunch will consider them and use them correctly. In this way, there's no need to be concerned about others not having NCrunch installed or needing to include the NCrunch.Framework dependency in your solution.

What do you think?
Yes that sounds like a working solution.
(ReSharper uses a similar functionality with their code annotation attributes. In addition they have a "copy default implementation to clipboard" and also an option of using a custom namespace e.g. "MyApp.Utils.ReSharperAnnotations").

Post a reply

Log in to reply.