Feature Suggestions

Add/Move "Allow parallel test execution" to the Project Level

Started by Rodney on 7,537 views

The allow parallel test execution setting on a solution is great. However it would be nice if at a project level we could turn it off, but leave other project on.

What this would me that the test within the project can run in parallel with other tests from other projects, just not with tests within its own project.

With this functionality when we have test within a project that for whatever (good or bad) reasons share resources across tests that they will not be competing for them if that is an issue. My example would testing a DAL and and using the new Microsoft LocalDB to help abstract a SQL Server Away to a local file. However when all the DB test run in parallel they are competing for access to the LocalDB file which only so many "connections" can be made at once. I can try to find a balance by increasing connections allowed, etc. However sometimes just having the test run synchronously would be an easier if we can just set it at the project level to only impact that project within its own tests.
Hi Rodney -

Thanks for the suggestion. Yang is correct that the best way to solve this problem is by adorning your integration tests with the above attributes to control their concurrency.

There is an item in the backlog to extend the support of these attributes so that they can also be applied at assembly level (and thus automatically apply to all tests within the assembly). It's looking at the moment like this functionality will be an NCrunch V2 thing.

For the time being, I recommend performing a find and replace for the [Test] attribute within your integration tests project, to replace it with something like: [Test, NCrunch.Framework.ExclusivelyUses("Database")].

Post a reply

Log in to reply.