Remco;11055 wrote: I strongly recommend setting your CI to run under a non system account if you're running .NET Core tests. I've made a note to investigate this further.
Thanks, yes this what actually want to use. So, when creating a new user accounts (1 for tc agent, 1 for grid node) I initially tried to build solution with ncrunch console only and that ended up with the following issues:
* Only building with ncrunch console:
Quote:
[08:31:22] : [Step 1/1] [08:31:22.7255-InitialisationQueueTask-13] ERROR (Load): Error occurred during load of component at C:\TeamCity\buildAgent\work\969002e4bbebde55\Labs.Dotnetcore.Misc\test\Labs.Misc.DotnetTest2\Labs.Misc.DotnetTest2.csproj: 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:
[08:31:22] : [Step 1/1] Assets file 'C:\TeamCity\buildAgent\work\969002e4bbebde55\Labs.Dotnetcore.Misc\test\Labs.Misc.DotnetTest2\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
[08:31:22] : [Step 1/1] Assets file 'C:\TeamCity\buildAgent\work\969002e4bbebde55\Labs.Dotnetcore.Misc\test\Labs.Misc.DotnetTest2\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
[08:31:22] : [Step 1/1] at nCrunch.Compiler.RemoteBuildRunner. (FilePath , LoadTimeQuery , String , String , DirectoryPath , String , String )
[08:31:22] : [Step 1/1] at nCrunch.Compiler.RemoteBuildRunner.AnalyseComponentBuild(ComponentLoadParameters parameters)
[08:31:22] : [Step 1/1] --- End of inner exception stack trace ---
* dotnet restore + ncrunch console:
Quote:
[08:39:05] : [Step 1/1] [08:39:05.4544-LocalBuildTask-11] ERROR (Internal): System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\TCAgent\.nuget\packages\Microsoft.NETCore.App'.
[08:39:05] : [Step 1/1] at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
[08:39:05] : [Step 1/1] at System.IO.FileSystemEnumerableIterator`1.CommonInit()
[08:39:05] : [Step 1/1] at System.IO.Directory.GetDirectories(String path)
[08:39:05] : [Step 1/1] at nCrunch.Common.IO.DirectoryPath.GetDirectories(String wildcardSpec)
[08:39:05] : [Step 1/1] at nCrunch.Core.PlatformTypes.DotNetCoreBuildExtender. (String )
[08:39:05] : [Step 1/1] at nCrunch.Core.PlatformTypes.DotNetCoreBuildExtender. (FilePath )
[08:39:05] : [Step 1/1] at nCrunch.Core.PlatformTypes.DotNetCoreBuildExtender. (SnapshotComponent , BuildOutput )
[08:39:05] : [Step 1/1] at nCrunch.Core.PlatformTypes.DotNetCoreBuildExtender.ProcessSuccessfulBuildOutput(SnapshotComponent component, BuildOutput buildOutput, IList`1 componentReferences)
[08:39:05] : [Step 1/1] at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender)
[08:39:05] : [Step 1/1] at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
[08:39:05] : [Step 1/1] at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
[08:39:05] : [Step 1/1] at nCrunch.Client.Processing.ProcessingQueue. . ()
* dotnet restore + nuget restore (Using nuget.exe 4.1! Nuget 3.5 and nuget 4.3 do not restore the packages) + ncrunch console:
- Note: nuget 4.3 is required to build netcore2.0 app referencing netstandard2.0 to avoid nuget restore error like Project x is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0).
Quote:
...
<tons of nuget packages will get installed to c:\Users\TCAgent, including microsoft.netcore.app>
[11:27:04][Step 1/1] [09:27:04.4378-LocalAnalysisTask-22] ERROR (Internal): nCrunch.TaskRunner.Ipc.IpcConnectionClosedException: The connection has been closed
[11:27:04][Step 1/1] at nCrunch.TaskRunner.Ipc.Fast.IpcReader.Initialise()
...
Here it starts to get very "interesting":
1) Running NCRunch console within TC Agent with my normal admin user, everything works fine (1 test failure).
2) Running NCRunch console within TC Agent with my new TCAgent user, above Ipc exception is thrown.
3) Running NCRunch console outside TC Agent, with my new TCAgent user, NCrunch reports "Returning result: OK" (NOT expected - seems to not even be able to discover the tests?).
4) Running NCRunch console outside TC Agent, with my normal admin user, NCrunch reports "Returning result: TestFailure" (as expected).
NCrunch command used in all above scenarios:
Quote:
&"C:\Program Files (x86)\Remco Software\NCrunch Console Tool\NCrunch.exe" "C:\TeamCity\buildAgent\work\969002e4bbebde55\Labs.Dotnetcore.Misc\Labs.Misc.sln" -LogVerbosity Summary /O "C:\TeamCity\buildAgent\work\969002e4bbebde55\Labs.Dotnetcore.Misc\_NCrunch\Result" -WorkspaceBasePath "C:\TeamCity\buildAgent\work\969002e4bbebde55\Labs.Dotnetcore.Misc\_NCrunch\WC" -NCrunchCacheStoragePath "C:\TeamCity\buildAgent\work\969002e4bbebde55\Labs.Dotnetcore.Misc\_NCrunch\Cache"
:|
*Edit: Additioal tests I did which did not help for scenario 3: ensured c:\Users\...\.nuget\packages content was identical for both users, change TCAngent user to be admin.
*Edit2: Scenario 2 was fixed by copying packages folder between the 2 users so something seems to be missing there.