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



HotChocolate repo - Stictching solution - NCrunch keeps busy
Dirk Maegh
#1 Posted : Tuesday, January 26, 2021 12:12:57 PM(UTC)
Rank: Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 24
Location: Belgium

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

I started at a new ciient yesterday and they recommended me to take a look at the unittests of hotchocolate, in particular the stictching ones.
I loaded the solution, and looked at some unittests.

When I wanted to run them with ncrunch however, ncrunch kept getting busy, like it was trying to load and reload the same projects over and over (or I am not patient enough - is the other option)

I am on ncrunch on Windows 10, VS2019 (latest versions of Windows and VS2019)

repo https://github.com/ChilliCream/hotchocolate.git
main branch
Solution src\HotChocolate\Stitching\HotChocolate.Stitching.sln

I executed build.ps1

I just enabled ncrunch, and got project load errors, while ncrunch keeps "spinning" its engine core load progress bar (progress going up and down repeatedly for a looong time)

I get the following load error:

System.Exception: An exception was thrown in the remote environment: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> nCrunch.Common.UserException: Errors occurred while trying to load the project file:
The target "_SplitProjectReferencesByFileExistence" does not exist in the project.
at nCrunch.Compiler.ComponentAnalysisContext.()
at nCrunch.Compiler.ComponentAnalysisContext.AnalyseComponentBuild()
at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.(CallMethodMessage )
at nCrunch.TaskRunner.Ipc.IpcMessageProcessor.ProcessMessageReturningResult(Byte[] data)
at nCrunch.TaskRunner.Ipc.RemoteInstance.(Byte[] )
at nCrunch.TaskRunner.Ipc.RemoteInstance.Invoke(IMessage msg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at nCrunch.Compiler.IRemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
at nCrunch.Core.BuildManagement.BuildProcessLauncher..(IRemoteBuildRunner )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , FilePath , String , ExternalProcess )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress )
at nCrunch.Core.BuildManagement.BuildProcessLauncher.AnalyseComponentBuildInExternalProcess(ComponentLoadParameters parameters, IList`1 customEnvironmentVariables)
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.(EffectiveProcessorArchitecture , String )
at nCrunch.Client.ComponentLoader.SnapshotComponentLoader.CreateComponentFromXml(FilePath projectFilePath, ParsedBuildXml projectXml, FilePath solutionFilePath, String[] additionalFilesToIncludeAtSolutionLevel, Boolean isLoadedFromFile, VisualStudioVersion vsVersion, ComponentUniqueName componentName, TaskSettings componentTaskSettings, Exception parseException, String targetFramework)

#2 Posted : Wednesday, January 27, 2021 2:53:01 AM(UTC)
Rank: NCrunch Developer

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

Thanks: 814 times
Was thanked: 1088 time(s) in 1032 post(s)
Hi, thanks for sharing this issue.

This solution is failing to load under NCrunch because it dynamically specifies the TargetFrameworks property for the projects involved using Directory.build.props files and using custom build properties. We currently do not support working with such a setup under NCrunch, as we need the TargetFrameworks to be determined before attempting to load each project.

To work around this, you need to specify a custom build property of 'TargetFrameworks' for all the projects involved. I would recommend setting this to 'net5.0' at solution level in your NCrunch configuration.

I've noticed that our error handling in this area is not working correctly. NCrunch is forever attempting to reload the failed projects, causing flickering in the UI. It shouldn't do that. There'll be a fix for this endless reload cycle coming in the next build.
Dirk Maegh
#3 Posted : Wednesday, January 27, 2021 6:31:47 AM(UTC)
Rank: Member

Groups: Registered
Joined: 11/30/2016(UTC)
Posts: 24
Location: Belgium

Thanks: 4 times
Was thanked: 4 time(s) in 4 post(s)
Hey, thanks for your excellent answer !
It fixed loading the solution and running its tests definitely.

It felt awkward however pasting the same build property to every project manually, given the number of projects. I had to "paste" two values every time, so I decided to paste in the build property name, as it was longer, and type the net5.0 value every time.
It took me a lot of minutes to get that done. I feel there must be a simpler way - selecting all projects and entering it once for all ? But I understand that feature would not be there at this moment ;)

I just tried selecting a bunch of projects in the configuration window, and I have the feeling I can add the same build property - had I only known that before... Never too old to learn I guess ;)
But when I select a few projects that I know already have the same build properties and the same values for them, the window does not show these build properties anyway. (safety measure I am sure ;)

And now that I re-read your answer, I should have put this "at solution level" - I should pay better attention. I'm sorry...

Thanks for helping me out getting ncrunch running already !
1 user thanked Dirk Maegh for this useful post.
Remco on 1/27/2021(UTC)
Users browsing this topic
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.237 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download