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

Notification

Icon
Error

Configuration Advice
MaxGuernsey
#1 Posted : Thursday, April 16, 2020 6:38:24 PM(UTC)
Rank: Member

Groups: Registered
Joined: 5/22/2015(UTC)
Posts: 12
Location: United States of America

Thanks: 4 times
Was thanked: 4 time(s) in 3 post(s)
Hi,

My solution has many projects in it with a sophisticated network of dependencies.

Certain technology choices I've made seem to be making builds very slow by thwarting incremental build times. However, these technologies are encapsulated in assemblies I don't need to build in order to run my unit tests, which is what I use NCrunch for, at this time.

What is the best way to configure NCrunch to only build my unit tests and all their dependencies? I know I can use the "ignore completely" feature but then I have to maintain the list of ignored projects independently of my project dependencies. I could have a separate solution with only the unit tests and production code but then I can't get whole-solution refactoring and unit tests at the same time.

What I'm looking for is a way to do the equivalent of selecting a project, right-clicking, and selecting "build"...but for NCrunch. That is, rather than telling NCrunch to ignore certain projects, I would like to tell it to care about certain projects and have it ignore everything that is not necessary for those projects.

This is not a feature request. This is a pre-feature-request query to make sure I don't file a feature request for a feature that already exists.

Thanks,
Max
Remco
#2 Posted : Friday, April 17, 2020 12:42:40 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi Max,

Thanks for posting.

As NCrunch works with your source code in its pre-built state, there are some serious limits to what we can do here. Structurally, we can't make use of the assemblies that may have been pre-built by the IDE ... This is due to a range of issues such as concurrency restrictions, assembly structure, build chaining issues, configuration constraints, metrics holes, etc. This means that for NCrunch to use an assembly derived from a project, it must take responsibility for building that project itself.

The good news is that once a project has been built by NCrunch, it won't need to build it again unless you reset the engine or alter any source code inside the built project. This means that the weighty projects slowing you down should only slow you down when the engine first spins up. They may also carry some weight in some of the internal engine operations, such as building data for the UI and merging code coverage, but we've optimised these areas very heavily over the years so you'll need some serious weight to notice a big change in these.

From here, there are a couple of options if you want to remove these projects from the scope of NCrunch. Neither of these are ideal and in each case they are likely to be more trouble than they are worth:

- You can use the 'Ignore this project completely' setting to remove unwanted projects from NCrunch's internal solution. Note that this will only work for projects that none of your crunchable code relies on. If you try to ignore a required project, the engine will fail to build its dependencies.

- You can externalise the unwanted projects by using assembly references instead of project references. Removing them from the solution is possible but not required (as you can ignore them under NCrunch). In theory, it may be possible to use MSBuild conditions to have a project reference in place for Visual Studio, and an assembly reference in place for NCrunch. I don't know how the IDE would behave with such a structure though, and it'll be quite fragile. Regardless, you'd be wanting to pre-build the project using the IDE and store its built assembly in a place that is referenced and manually updated.
MaxGuernsey
#3 Posted : Saturday, April 18, 2020 12:11:03 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/22/2015(UTC)
Posts: 12
Location: United States of America

Thanks: 4 times
Was thanked: 4 time(s) in 3 post(s)
There has been a misunderstanding. Working with my source code in its pre-built state - exactly what you have now - is what I want.

The feature I will be requesting (through the proper channel) is that there be two modes for selecting which projects are monitored and which are ignored.
- Opt-out (what we have now): Everything builds unless it is explicitly "ignored completely"
- Opt-in (the new mode): Nothing builds unless it is explicitly selected for monitoring or a dependency of something that was selected for monitoring.

It probably will never gain enough popularity to be implemented but it's also a cheap feature to implement, so who knows.
MaxGuernsey
#4 Posted : Saturday, April 18, 2020 12:19:07 AM(UTC)
Rank: Member

Groups: Registered
Joined: 5/22/2015(UTC)
Posts: 12
Location: United States of America

Thanks: 4 times
Was thanked: 4 time(s) in 3 post(s)
I've added a user voice entry for this:

https://ncrunch.uservoic...n-of-which-problems-are

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.034 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download