New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
append loader exceptions to error output #1296
append loader exceptions to error output #1296
Conversation
- clearly separates errors and steps in the output
d952430
to
5899d0f
Compare
Nice PR! |
@SabotageAndi I think it's ready for review I could not add an automated test for the last case because I could not generate a solution with multiple assemblies using the test project generator. On @icnocop 's test project the loader errors are printed to stdout through the tracer and the exception is rethrown (I reverted that catch block, so that part is unchanged) <TestRun ....>
[....]
<ResultSummary outcome="Failed">
<Counters total="1" executed="1" error="0" failed="1" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" passed="0" completed="0" inProgress="0" pending="0" />
<Output>
<StdOut>-> Using app.config
-> error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
-> error: Type Loader exceptions:
-> error: LoaderException: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.TestTools.UITest.Extension.Silverlight, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
</StdOut>
</Output>
</ResultSummary>
[....]
<Results>
<UnitTestResult executionId="9023b9d3-b616-4831-a11a-60ac068725ab" testId="a4d4bb77-6d20-bde9-302e-03a2b557dafc" testName="Test" computerName="IE11WIN8_1" startTime="2018-10-08T23:02:39.2511726-07:00" endTime="2018-10-08T23:02:39.6262525-07:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="9023b9d3-b616-4831-a11a-60ac068725ab">
<Output>
<ErrorInfo>
<Message>Class Initialization method CodedUITestProject4.SpecFlowFeature1Feature.FeatureSetup threw exception. System.Reflection.ReflectionTypeLoadException: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..</Message>
<StackTrace> at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at TechTalk.SpecFlow.Bindings.Discovery.RuntimeBindingRegistryBuilder.BuildBindingsFromAssembly(Assembly assembly) in C:\devel\GitHub\SpecFlow\TechTalk.SpecFlow\Bindings\Discovery\RuntimeBindingRegistryBuilder.cs:line 22
at TechTalk.SpecFlow.TestRunnerManager.BuildBindingRegistry(IEnumerable`1 bindingAssemblies) in C:\devel\GitHub\SpecFlow\TechTalk.SpecFlow\TestRunnerManager.cs:line 94
at TechTalk.SpecFlow.TestRunnerManager.InitializeBindingRegistry(ITestRunner testRunner) in C:\devel\GitHub\SpecFlow\TechTalk.SpecFlow\TestRunnerManager.cs:line 69
at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(Int32 threadId) in C:\devel\GitHub\SpecFlow\TechTalk.SpecFlow\TestRunnerManager.cs:line 58
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunnerWithoutExceptionHandling(Int32 threadId) in C:\devel\GitHub\SpecFlow\TechTalk.SpecFlow\TestRunnerManager.cs:line 144
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Int32 threadId) in C:\devel\GitHub\SpecFlow\TechTalk.SpecFlow\TestRunnerManager.cs:line 131
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Nullable`1 managedThreadId) in C:\devel\GitHub\SpecFlow\TechTalk.SpecFlow\TestRunnerManager.cs:line 203
at CodedUITestProject4.SpecFlowFeature1Feature.FeatureSetup(TestContext testContext)
</StackTrace>
</ErrorInfo>
</Output>
</UnitTestResult>
</Results>
</TestRun>``` |
@szaliszali looks good for me. Thanks for the work! |
Thanks for your contribution to SpecFlow. If you would like us to send you some SpecFlow stickers as a thank you, please fill out the form here. |
Fixes #1293
extend
TestTracer.TraceError
ReflectionTypeLoadException
Types of changes
Checklist: