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

Notification

Icon
Error

When there are many dependent projects, tests can end up taking a very long time to be scheduled.
otac0n
#1 Posted : Wednesday, July 9, 2014 9:01:02 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/22/2011(UTC)
Posts: 51
Location: Seattle, WA

Was thanked: 7 time(s) in 7 post(s)
We have a solution with over a hundred projects. There is a project near the center of all of this called "Woot.Framework", which acts as a supplement to the .NET Framework for us.

Our problem: this project should be the most heavily tested project, but NCrunch makes testing it painful. Any time we modify the project, all other projects in our solution are rebuilt. This would be fine, except for the fact that this process can take several minutes, and none of our tests will run until ALL of the projects are built.

This happens to a lesser extent when dealing with other, less centralized projects, but it is the source of quite a lot of frustration recently.

Would it be possible to use previous builds to inform the "priority" of building and analyzing assemblies such that the innermost tests could run before all other projects are even built?
Remco
#2 Posted : Wednesday, July 9, 2014 10:06:53 PM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
NCrunch will rebuild all dependencies of a project if they have the 'Copy referenced assemblies to workspace' setting enabled, or if you make a change to the project that impacts a public interface (i.e. you change the signature of a public method).

In all other situations, NCrunch will do exactly as you've described - it will re-use the previously built assemblies for these projects and simply go straight to running the tests.

Are you making use of the 'Copy referenced assemblies to workspace' setting? If so, do you have any opportunities to turn it back off?
otac0n
#3 Posted : Wednesday, July 9, 2014 11:04:26 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/22/2011(UTC)
Posts: 51
Location: Seattle, WA

Was thanked: 7 time(s) in 7 post(s)
Well, I was adding and changing public methods, so that could have been doing it. Even still, why should I have to wait for all projects to build for my most basic tests to run?

My solution for now has been to filter my SLN to just the projects I need using SLNTools, which is actually working like a charm as a workaround.
Remco
#4 Posted : Thursday, July 10, 2014 1:26:21 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Unfortunately NCrunch does need to rebuild dependencies when a public interface changes. This is to avoid obscure problems such as 'Method not found' exceptions that can otherwise be thrown during test execution.

Note that NCrunch won't rebuild projects that do not have a direct or indirect dependency on the changed project.

Something you may be interested in is the recently introduced build priority configuration setting. This allows you to control the priority of build tasks added to the queue. If you have multiple test projects running tests at different hierarchical levels of your solution and the engine is tying up resources rebuilding when it could potentially be executing tests (for example, if the lower level projects have already been rebuilt), you may wish to reduce the priority NCrunch assigns to build tasks so that more resources are put towards testing.
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.040 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download