Age | Commit message (Collapse) | Author |
|
This reverts commit d0821012bf30ce2771d1bc878a34f6bd555b00ba.
|
|
Add support for .NET 6
|
|
That's required for Xamarin.Mac, since it needs to call
exit(code) to report the code
|
|
Add some more markers where ExitCode should be set to non-zero
|
|
|
|
Running GuiUnit under .NET 6 causes test assembly dependencies not
to be resolved even though a parent process has already called
Assembly.LoadFrom. It seems that a call to LoadFile for the assembly
results in dependencies not being resolved. Switch to LoadFrom which
will resolve dependencies.
|
|
No way to currently run tests that require a UI main loop
with XWT or Xamarin.Mac on .NET 6. Added a temporary hack
that adds a console based main loop, using a queue, and
also registers a SynchronisationContext with the same loop
with MonoDevelop.Core.Runtime. This prevents tests in
MonoDevelop.Core hanging waiting for tasks to complete
on the UI thread.
|
|
Printing just the test name is confusing, because there can be multiple tests
with the same name.
|
|
This caused a weird issue where we had the following:
Most of the MD assemblies built against GuiUnit.
MonoDevelop.MonoDroid.Tests built against GuiUnit-Ng.
Since we switched to test deployment, GuiUnit seemed to be the last one
being copied.
Thus, the Android tests would fail to load:
```
2018-08-02T08:55:18.2470490Z Can't find custom attr constructor image: /Users/vsts/agent/2.138.4/work/r1/a/VS for Mac/drop/tests/MonoDevelop.MonoDroid.Tests.dll mtoken: 0x0a000008 due to: Could not resolve type with token 01000013 (from typeref, class/assembly NUnit.Framework.OneTimeTearDownAttribute, GuiUnit, Version=1.0.6397.19727, Culture=neutral, PublicKeyToken=8ebbaf189675e490) assembly:GuiUnit, Version=1.0.6397.19727, Culture=neutral, PublicKeyToken=8ebbaf189675e490 type:NUnit.Framework.OneTimeTearDownAttribute member:(null) signature:<none>
2018-08-02T08:55:18.2513870Z System.TypeLoadException: Could not resolve type with token 01000013 (from typeref, class/assembly NUnit.Framework.OneTimeTearDownAttribute, GuiUnit, Version=1.0.6397.19727, Culture=neutral, PublicKeyToken=8ebbaf189675e490)
2018-08-02T08:55:18.2534360Z at (wrapper managed-to-native) System.MonoCustomAttrs.IsDefinedInternal(System.Reflection.ICustomAttributeProvider,System.Type)
2018-08-02T08:55:18.2557740Z at System.MonoCustomAttrs.IsDefined (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00027] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System/MonoCustomAttrs.cs:317
2018-08-02T08:55:18.2581720Z at System.Reflection.MonoMethod.IsDefined (System.Type attributeType, System.Boolean inherit) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:386
2018-08-02T08:55:18.2605460Z at NUnit.Framework.Internal.Reflect.GetMethodsWithAttribute (System.Type fixtureType, System.Type attributeType, System.Boolean inherit) [0x0001a] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/Reflect.cs:71
2018-08-02T08:55:18.2628860Z at NUnit.Framework.Internal.TestFixture..ctor (System.Type fixtureType, System.Object[] arguments) [0x00008] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/Tests/TestFixture.cs:53
2018-08-02T08:55:18.2653880Z at NUnit.Framework.Builders.NUnitTestFixtureBuilder.BuildSingleFixture (System.Type type, NUnit.Framework.TestFixtureAttribute attr) [0x00033] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/Builders/NUnitTestFixtureBuilder.cs:160
2018-08-02T08:55:18.2677470Z at NUnit.Framework.Builders.NUnitTestFixtureBuilder.BuildFrom (System.Type type) [0x00038] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/Builders/NUnitTestFixtureBuilder.cs:110
2018-08-02T08:55:18.2700470Z at NUnit.Framework.Internal.TestFixtureBuilder.BuildFrom (System.Type type) [0x00000] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/TestFixtureBuilder.cs:65
2018-08-02T08:55:18.2724530Z at NUnit.Framework.Internal.NUnitLiteTestAssemblyBuilder.GetFixtures (System.Reflection.Assembly assembly, System.Collections.IList names) [0x0002a] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/NUnitLiteTestAssemblyBuilder.cs:110
2018-08-02T08:55:18.2748530Z at NUnit.Framework.Internal.NUnitLiteTestAssemblyBuilder.Build (System.Reflection.Assembly assembly, System.Collections.IDictionary options) [0x00018] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/NUnitLiteTestAssemblyBuilder.cs:52
2018-08-02T08:55:18.2772390Z at NUnit.Framework.Internal.NUnitLiteTestAssemblyRunner.Load (System.Reflection.Assembly assembly, System.Collections.IDictionary settings) [0x00007] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/Internal/NUnitLiteTestAssemblyRunner.cs:96
2018-08-02T08:55:18.2795930Z at GuiUnit.TestRunner.ExecuteWithListener (System.String[] args, NUnitLite.Runner.TcpWriter tcpWriter) [0x0016f] in /Users/vsts/agent/2.138.4/work/1/s/md-addins/external/guiunit/src/framework/GuiUnit/TestRunner.cs:188
```
Since GuiUnit did not report exit code failure for any exception in the harness,
most of the shell scripts which would verify the exit code would just continue
and consider the test run successful.
In case of any exception other than FileNotFoundException, we return 1 as exit code.
Fixes VSTS 657366 - CI does not fail if the test runner fails to run
|
|
On linux/macOS the exit code is byte-sized, which means that if 256 tests
fails, the exit code would become 0.
|
|
This reverts commit f1b9f939acdd72bf481eb5697fd9838fd1ba2464.
This didn't help, so let's just try to fix the actual problem
|
|
If we allow the finalizers to run we may end up returning
a failure exit code if the finalizer does something wrong.
For example xamarin.mac can crash while finalizing CALayers
but we do not really want that to mark our test run as failed.
2017-02-27T02:37:28.1153580Z stderr: Unhandled Exception:
2017-02-27T02:37:28.1186210Z stderr: System.Exception: Failed to marshal the Objective-C object 0x7f85edb651e0 (type: Xamarin_Designer_Mac_DesignerDragOperationMac_MacDragImage_LayerScaleTransitionDelegate). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Xamarin.Designer.Mac.DesignerDragOperationMac+MacDragImage+LayerScaleTransitionDelegate' does not have a constructor that takes one IntPtr argument).
2017-02-27T02:37:28.1204140Z stderr: at ObjCRuntime.Runtime.MissingCtor (System.IntPtr ptr, System.IntPtr klass, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution resolution) [0x0006e] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1218240Z stderr: at ObjCRuntime.Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x0002c] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1232350Z stderr: at ObjCRuntime.Runtime.ConstructNSObject (System.IntPtr ptr, System.IntPtr klass, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x00015] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1246740Z stderr: at ObjCRuntime.Runtime.GetNSObject (System.IntPtr ptr, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution, System.Boolean evenInFinalizerQueue) [0x00034] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1260580Z stderr: at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject (System.Type type, System.IntPtr selector, System.IntPtr obj, System.IntPtr& mthis) [0x00068] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1274350Z stderr: at ObjCRuntime.Runtime.GetMethodAndObjectForSelector (System.IntPtr klass, System.IntPtr sel, System.IntPtr obj, System.IntPtr& mthis) [0x0000c] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1289980Z stderr: at ObjCRuntime.Runtime.get_method_and_object_for_selector (System.IntPtr cls, System.IntPtr sel, System.IntPtr obj, System.IntPtr& mthis, System.Int32& exception_gchandle) [0x00006] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1313850Z stderr: --- End of stack trace from previous location where exception was thrown ---
2017-02-27T02:37:28.1331490Z stderr: at (wrapper managed-to-native) ObjCRuntime.Messaging:void_objc_msgSend_IntPtr (intptr,intptr,intptr)
2017-02-27T02:37:28.1345900Z stderr: at CoreAnimation.CALayer.set_WeakDelegate (Foundation.NSObject value) [0x0002e] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1358800Z stderr: at CoreAnimation.CALayer.OnDispose () [0x00024] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1371610Z stderr: at CoreAnimation.CALayer.Dispose (System.Boolean disposing) [0x00001] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
2017-02-27T02:37:28.1384350Z stderr: at Foundation.NSObject.Finalize () [0x00001] in <fc5e1fa5f40e47b7ab6a305f19513423>:0
|
|
|
|
The calling assembly will always be guiunit itself. All our
tests are written in different assembly. As such, if we aren't
given the path to an assembly we should assume that something else
is loading us and the thing which loaded us has the tests.
|
|
This allows custom main loop integrations to use it when
Shutdown is called in the case where the integration's
IMainLoopIntegration.RunMainLoop is a no-op (e.g. the
main loop is running already).
|
|
Such a hack :)
|
|
|
|
We want to gracefully shut down the socket when possible.
|
|
|
|
This should make it easier to detect failures when run from the
commandline
|
|
`Assembly.LoadFile` and `Assembly.Location` are not present on Windows
Phone. To allow us to keep our hard coded list of main loop integrations
(and other support), we'll check for these methods at runtime and properties
and skip steps that aren't required/supported on Windows Phone.
|
|
Sometimes someone will want to set up their own SyncronizationContext
and have the tests run without calling any special setup/shutdown
methods. This isn't fully tested but if there are bugs i can fix em.
|
|
|
|
|
|
It's now hidden behind a nice interface which can be changed on startup
if required.
|