Insufficient error handling message in ProcessRunner -> RunTests method
See original GitHub issue@Fernell commented on Fri Jul 28 2017
log.Error(“Failed to run remote tests {0}”, e.Message); is insufficeint. It lacks details required to diagnose problem. Here is sample of my log:
An exception occurred in the driver while loading tests. Server stack trace: at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage) at NUnit.Engine.Runners.DirectTestRunner.LoadPackage() at NUnit.Engine.Runners.TestDomainRunner.LoadPackage() at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded() at NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Runners.AbstractTestRunner.Run(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Runners.AggregatingTestRunner.RunTestsSequentially(ITestEventListener listener, TestFilter filter, List`1 results, Boolean disposeRunners) at NUnit.Engine.Runners.AggregatingTestRunner.RunTests(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Runners.AbstractTestRunner.Run(ITestEventListener listener, TestFilter filter) at NUnit.Engine.Agents.RemoteTestAgent.Run(ITestEventListener listener, TestFilter filter) at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Object[]& outArgs) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
I was unable to recognize error only by this stack trace. I was forced to download nunit3-console binaries and debug it myself. I found out that useful error message was in ex.InnerException which is not returned in error message at all. Please extend error message by adding ex.InnerException message.
@ChrisMaddock commented on Fri Jul 28 2017
This is an nunit-console issue, I’ll move it over to that repository.
@Fernell - we’d appreciate a Pull Request, if you were willing.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
I think this may be a general issue for some of our console logging.
In the framework, we have ExceptionHelper - which flattens exceptions hierarchy, and (theoretically) ensures everything useful is printed. Having an equivalent in the console would be nice.
https://github.com/nunit/nunit/blob/master/src/NUnitFramework/framework/Internal/ExceptionHelper.cs#L159
Hi everyone, I’m not sure if it is the same issue #270 but I’ve found a solution and I’ve published a comment there with an example.