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

Notification

Icon
Error

Tests build & run in VS2010, but not in NCrunch
adean
#1 Posted : Saturday, May 5, 2012 3:58:50 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/5/2012(UTC)
Posts: 8

Thanks: 1 times
Trying to evaluate NCrunch against Cavity but although the tests build & run in Visual Studio, NCrunch doesn't work (it says "project is failing to build").

I suspect that it is because I import MSBuild project settings using <Import ...> and that these are not being correctly evaluated by NCrunch but my attempts to isolate the problem are stymied by the lack of failure info provided by NCrunch.

To reproduce the issue, you can get http://code.google.com/p/cavity/ and open any solution. You will need to install the MSBuild extensions as well (there is an MSI available in the downloads list).

Regards,
Alan

P.S.

If this is Remco reading it, hope all is going well - Gordon prompted me to take a look at NCrunch. I would be interested in knowing what your price point is likely to be when you release as I think one of my current clients could be a customer.

BTW: Your bug report tool doesn't seem to work - complains that there is no internet connection.
Remco
#2 Posted : Sunday, May 6, 2012 12:06:46 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
Hi Alan! It's great to hear from you and I hope that all is well.

I've had a go at running NCrunch against Cavity, and I think that you may have some work ahead of you to make NCrunch work correctly against a solution of this structure.

NCrunch works by extracting individual projects from their solution, isolating them in another area of your hard drive, then building and testing them in this isolated environment. In order to properly isolate a project, NCrunch needs full control over the way in which the project references other projects and DLLs. This control is exerted over the project by manipulating the .proj file at an XML level inside the NCrunch workspace, replacing the <Reference> and <ProjectReference> tags with <Reference> tags to the specific assemblies required to build the project. This creates problems when working with Cavity, as Cavity stores its shared assembly references in the 'Any.references' and 'Web.references' files - which cannot be manipulated by NCrunch. The result is that NCrunch is throwing exceptions while preparing Cavity's .proj files for build.

After moving the shared references out of the MSBuild imports, NCrunch worked correctly for me against the Cavity.Web solution. I assume that the other solutions could be fixed the same way.

If you need to get more error information out of NCrunch, the best place to look is the processing queue. If you set your 'Logging verbosity' to 'Detailed' under your NCrunch Global configuration, the queue will show you detailed error/trace information directly from the MSBuild output.

Something you may find useful is that NCrunch sets an environment variable $(NCrunch) == '1' in its build environment, which you can use to implement custom build paths/logic.

I'd really like to learn more about why the bug report tool failed for you. Others have also complained of this, and I'm hoping to try and rule out any connectivity issues. If you still have me on skype, maybe ping be sometime when you're free as I'd really like to run some connectivity tests. There's not much worse (or more ironic) than a bug in a bug reporter ...


Cheers,

Remco
1 user thanked Remco for this useful post.
adean on 5/6/2012(UTC)
adean
#3 Posted : Sunday, May 6, 2012 8:15:55 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/5/2012(UTC)
Posts: 8

Thanks: 1 times
Moving the <Reference ...> list inside the .csproj fixed the problem, thanks :-)

Is there any way you could simply resolve the problem 'inside' the tool by merging all imports into the .csproj copy? I'm pretty sure that effectively what MSBuild does (although it probably does so to an in-memory graph).

For something like Cavity, swapping to a more manual configuration story is not that big a deal, but in a corporate environment it's likely to be a bigger impediment to buying the tool (plus, I guess most customers will figure: if VS can build my project, then so should NCrunch). My current and previous clients both used corporate MSBuild extensions to make build management easier (I reckon both are potential customers: getting buy-in for TDD is damned hard work, as I'm sure you are aware, and surfacing coverage in the way NCrunch does should help drive TDD acceptance, I think).

Yes, I still have you in Skype. Happy to talk through / investigate the bug reporting issue and I can give you the sales lead info as well.
Remco
#4 Posted : Sunday, May 6, 2012 9:42:33 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,970

Thanks: 929 times
Was thanked: 1256 time(s) in 1169 post(s)
The tricky thing with solving this inside NCrunch is that doing so would require NCrunch to have a logical understanding of the entire workings of the build scripts being included by the <Import> tags in the proj file. In the case of Cavity, a very rudimentary understanding would be ok (as the scripts do not contain dynamically derived References), though you can imagine the complication if someone were to have a build script with logic where the reference to a particular assembly was calculated using an MSBuild task non-deterministically.

The general goal behind NCrunch's workspacing has been to make it as configuration-less as possible, though for situations where people have heavily customised/hand-scripted build environments, providing meaningful error information is often the only feasible alternative. In this particular situation, the error was obscure and did not give any indication on what was causing the problem or how to resolve it. That is definitely something I need to address.
hydraulic
#8 Posted : Thursday, May 10, 2012 12:05:57 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2012(UTC)
Posts: 1

NCrunch for visual studio 10 is the best stuff for the developers.I think it would really a good software to use.
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.049 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download