Skip to content
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

[Mono.Android-Test] Import Mono.Android tests from monodroid/9c5b3712 #32

Merged
merged 1 commit into from
May 16, 2016

Conversation

jonpryor
Copy link
Member

@jonpryor jonpryor commented May 10, 2016

Import monodroid/tests/runtime from monodroid/9c5b3712.

Add a toplevel make run-all-tests target to run the tests.
make run-all-tests requires that adb be in $PATH, along with
basename(1), and uses GNU make(1) features, and...

Sorry potential/future Windows developers.


@dellis1972: At least two issues that should be addressed in separate PRs (part of why this isn't suitable for merging):

  1. ResolveLibraryProjectImports was changed to use System.IO.Compression instead of Ionic.Zip.dll, because Ionic.Zip.dll was throwing an exception from Files.Extract():

    Error executing task ResolveLibraryProjectImports: System.ArgumentException: Path is empty
      at System.IO.Directory.CreateDirectory (System.String path) <0x1a20ca0 + 0x0011c> in <filename unknown>:0 
      at Ionic.Zip.ZipEntry.InternalExtract (System.String baseDir, System.IO.Stream outstream, System.String password) <0x3af4b78 + 0x002e7> in <filename unknown>:0 
    

    No idea why that's happening. Using System.IO.Compression allowed me to proceed, but I don't know if that's the correct answer.

  2. BuildApk was changed to look for the correct libmono-profiler-*.so file, removing the ABI from the name.

Do you have any thoughts on why (1) is happening?


The above two issues have been corrected in separate PRs. This PR is ready for merging, with the "minor" issue that the contained tests do not pass.

@jonpryor
Copy link
Member Author

Additionally, this PR crashes on device:

05-13 11:00:38.059 13246 13603 E mono    : Unhandled Exception:
05-13 11:00:38.059 13246 13603 E mono    : System.ObjectDisposedException: Cannot access a disposed object.
05-13 11:00:38.059 13246 13603 E mono    : Object name: 'System.Net.Sockets.Socket'.
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () <0xa93bab28 + 0x00054> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.Sockets.Socket.AcceptAsync (System.Net.Sockets.SocketAsyncEventArgs e) <0x9c25e900 + 0x0001b> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.EndPointListener.Accept (System.Net.Sockets.Socket socket, System.Net.Sockets.SocketAsyncEventArgs e) <0x9c25e850 + 0x0003f> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.EndPointListener.ProcessAccept (System.Net.Sockets.SocketAsyncEventArgs args) <0x9c2457a0 + 0x0007f> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.EndPointListener.OnAccept (System.Object sender, System.Net.Sockets.SocketAsyncEventArgs e) <0x9c245770 + 0x00017> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted (System.Net.Sockets.SocketAsyncEventArgs e) <0x9c245728 + 0x0003b> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.Sockets.SocketAsyncEventArgs.Complete () <0x9c245700 + 0x0001f> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.Sockets.Socket.<AcceptAsyncCallback>m__0 (System.IAsyncResult ares) <0x9c2451a0 + 0x002af> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Net.Sockets.SocketAsyncResult+<Complete>c__AnonStorey0.<>m__0 (System.Object _) <0xa93a3ee0 + 0x0002b> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0xa93b7df0 + 0x0002f> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Threading.ThreadPoolWorkQueue.Dispatch () <0xa93b6a90 + 0x001bb> in <filename unknown>:0 
05-13 11:00:38.059 13246 13603 E mono    :   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0xa93b68e0 + 0x00007> in <filename unknown>:0 

Looks like a Mono bug?

@jonpryor
Copy link
Member Author

The two issues mentioned in the original message have been fixed. ResolveLibraryProjectImports was fixed in PR #41. BuildApk was fixed in PR #35.

Import monodroid/tests/runtime from monodroid/9c5b3712.

Add a toplevel `make run-apk-tests` target to "full stack" tests, in
which a .apk is created, installed, and executed on an attached
Android device. `make run-apk-tests` requires that `adb` be in $PATH,
and uses GNU make(1) features, and...

Additionally, tools/scripts/xabuild *must* be used to execute the
`SignAndroidPackage` target, to ensure that the local/"in tree"
assemblies are used. There is no "within xbuild" facility to alter
where target framework assemblies are resolved from, i.e no MSBuild
properties currently control the resolution order, only environment
variables, and MSBuild can't *set* environment variables...

The $(ADB_TARGET) variable can be used to control on which target
Android device the tests will be installed and executed on:

	# Install & run tests on *only* connected USB device
	$ make run-apk-tests ADB_TARGET=-d

	# Install & run tests on *only* connected emulator
	$ make run-apk-tests ADB_TARGET=-e

	# Install & run tests on specified device, listed via `adb devices`.
	$ make run-apk-tests ADB_TARGET="-s 036533824381cfcb"

Sorry potential/future Windows developers. *Running* tests will
require manual testing or running on OS X or Linux for now...

Note: These tests DO NOT PASS. In fact, they *crash*:

	$ make run-apk-tests
	...
	 Target RunTests:
	 	Executing: "$HOME/android-toolchain/sdk/platform-tools/adb"   shell am instrument -w Mono.Android_Tests/xamarin.android.runtimetests.TestInstrumentation
	 	INSTRUMENTATION_RESULT: shortMsg=Process crashed.
	 	INSTRUMENTATION_CODE: 0

	$ adb logcat
	...
	E mono    : Unhandled Exception:
	E mono    : System.ObjectDisposedException: Cannot access a disposed object.
	E mono    : Object name: 'System.Net.Sockets.Socket'.
	E mono    :   at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () <0xa93923f0 + 0x00054> in <filename unknown>:0
	E mono    :   at System.Net.Sockets.Socket.AcceptAsync (System.Net.Sockets.SocketAsyncEventArgs e) <0x9b8f9680 + 0x0001b> in <filename unknown>:0
	E mono    :   at System.Net.EndPointListener.Accept (System.Net.Sockets.Socket socket, System.Net.Sockets.SocketAsyncEventArgs e) <0x9b8f95d0 + 0x0003f> in <filename unknown>:0
	E mono    :   at System.Net.EndPointListener.ProcessAccept (System.Net.Sockets.SocketAsyncEventArgs args) <0x9b8e0340 + 0x0007f> in <filename unknown>:0
	E mono    :   at System.Net.EndPointListener.OnAccept (System.Object sender, System.Net.Sockets.SocketAsyncEventArgs e) <0x9b8e0310 + 0x00017> in <filename unknown>:0
	E mono    :   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted (System.Net.Sockets.SocketAsyncEventArgs e) <0x9b8e02c8 + 0x0003b> in <filename unknown>:0
	E mono    :   at System.Net.Sockets.SocketAsyncEventArgs.Complete () <0x9b8e02a0 + 0x0001f> in <filename unknown>:0
	E mono    :   at System.Net.Sockets.Socket.<AcceptAsyncCallback>m__0 (System.IAsyncResult ares) <0x9b8dfd40 + 0x002af> in <filename unknown>:0
	E mono    :   at System.Net.Sockets.SocketAsyncResult+<Complete>c__AnonStorey0.<>m__0 (System.Object _) <0xa892f720 + 0x0002b> in <filename unknown>:0
	E mono    :   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0xa938f6b8 + 0x0002f> in <filename unknown>:0
	E mono    :   at System.Threading.ThreadPoolWorkQueue.Dispatch () <0xa938e358 + 0x001bb> in <filename unknown>:0
	E mono    :   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0xa938e1a8 + 0x00007> in <filename unknown>:0

Looks like a Socket and/or ThreadPool bug in mono.
@dellis1972 dellis1972 merged commit 1b3a76c into dotnet:master May 16, 2016
radical pushed a commit that referenced this pull request May 8, 2018
…lies (#32)

Sign the Java.Interop, Java.Interop.Dynamic, and Java.Interop.Export
assemblies with the Xamarin.Android public key, so that
xamarin-android's Mono.Android.dll build can also be strong-named.
pjcollins added a commit to pjcollins/android that referenced this pull request Jun 15, 2022
jonpryor pushed a commit that referenced this pull request Jun 15, 2022
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jul 21, 2022
Changes: mono/opentk@50128f7...daa9b2d

  * mono/opentk@daa9b2d5: [nuget] use $(PackageLicenseExpression), not $(PackageLicenseUrl) (dotnet#35)
  * mono/opentk@351eb656: [ci] Use new EO compliant build pools (dotnet#33)
  * mono/opentk@95ab20b1: Try to fix DllNotFoundException under .net 6 (dotnet#32)
  * mono/opentk@3de39a40: Merge pull request dotnet#30 from dellis1972/proguard
  * mono/opentk@79ea8095: rework
  * mono/opentk@3311a8ac: Add Proguard config support
jonpryor added a commit to jonpryor/xamarin-android that referenced this pull request Jul 22, 2022
Changes: mono/opentk@50128f7...daa9b2d

  * mono/opentk@daa9b2d5: [nuget] use $(PackageLicenseExpression), not $(PackageLicenseUrl) (dotnet#35)
  * mono/opentk@351eb656: [ci] Use new EO compliant build pools (dotnet#33)
  * mono/opentk@95ab20b1: Try to fix DllNotFoundException under .net 6 (dotnet#32)
  * mono/opentk@3de39a40: Merge pull request dotnet#30 from dellis1972/proguard
  * mono/opentk@79ea8095: rework
  * mono/opentk@3311a8ac: Add Proguard config support
jonpryor added a commit that referenced this pull request Jul 26, 2022
Changes: mono/opentk@50128f7...daa9b2d

  * mono/opentk@daa9b2d5: [nuget] use $(PackageLicenseExpression), not $(PackageLicenseUrl) (#35)
  * mono/opentk@351eb656: [ci] Use new EO compliant build pools (#33)
  * mono/opentk@95ab20b1: Try to fix DllNotFoundException under .net 6 (#32)
  * mono/opentk@3de39a40: Merge pull request #30 from dellis1972/proguard
  * mono/opentk@79ea8095: rework
  * mono/opentk@3311a8ac: Add Proguard config support
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants