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

Notification

Icon
Error

Add project-level setting for running tests in parallel/sequential.
GreenMoose
#1 Posted : Thursday, October 11, 2012 3:11:28 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 507

Thanks: 145 times
Was thanked: 66 time(s) in 64 post(s)
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.
Remco
#2 Posted : Thursday, October 11, 2012 8:01:52 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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?
GreenMoose
#3 Posted : Friday, October 12, 2012 10:36:50 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 507

Thanks: 145 times
Was thanked: 66 time(s) in 64 post(s)
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.
Remco
#4 Posted : Saturday, October 13, 2012 12:36:09 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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?
GreenMoose
#5 Posted : Monday, October 15, 2012 7:45:16 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/17/2012(UTC)
Posts: 507

Thanks: 145 times
Was thanked: 66 time(s) in 64 post(s)
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").
1 user thanked GreenMoose for this useful post.
Remco on 10/15/2012(UTC)
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.036 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download