Skip to content

[Android] Run CoreCLR library tests on Android #114148

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

Merged

Conversation

kotlarmilos
Copy link
Member

@kotlarmilos kotlarmilos commented Apr 2, 2025

Description

This PR enables running CoreCLR library tests on the Android emulators and devices and adds a script for local testing on Windows.

Changes

  • Disabled library tests that require assemblies on disk
  • Disabled library tests that are failing on CoreCLR Android
  • Re-enabled passing tests on Android
  • Added a script for local testing on Windows

Disabled tests fall into two categories.

Globalization or other mobile‐platform issues

These tests have been disabled because they depend on invariant‐culture behaviors or platform APIs that aren’t fully supported on mobile targets:

System.Runtime\tests\System.Globalization.Tests\Invariant\Invariant.Tests.csproj
System.Net.Http\tests\FunctionalTests\System.Net.Http.Functional.Tests.csproj
System.Diagnostics.DiagnosticSource\tests\TestWithConfigSwitches\System.Diagnostics.DiagnosticSource.Switches.Tests.csproj
System.Reflection.MetadataLoadContext\tests\System.Reflection.MetadataLoadContext.Tests.csproj
System.Runtime\tests\System.Resources.ResourceManager.Tests\System.Resources.ResourceManager.Tests.csproj
System.Runtime\tests\System.Runtime.Tests\InvariantTimezone\System.Runtime.InvariantTimezone.Tests.csproj
System.Runtime.Loader\tests\System.Runtime.Loader.Tests.csproj
System.Runtime\tests\System.Text.Encoding.Tests\System.Text.Encoding.Tests.csproj
System.Runtime\tests\System.IO.Tests\System.IO.Tests.csproj
Microsoft.Bcl.Cryptography\tests\Microsoft.Bcl.Cryptography.Tests.csproj
System.Net.Security\tests\FunctionalTests\System.Net.Security.Tests.csproj
System.Net.WebSockets\tests\System.Net.WebSockets.Tests.csproj

CoreCLR Android-specific failures

The following disabled tests are specific to CoreCLR Android:

Microsoft.VisualBasic.Tests.ErrObjectTests.Clear
MonoTests.System.Configuration.mapped_ExeConfiguration_null
MonoTests.System.Configuration.OpenExeConfiguration1_UserLevel_None
System.Threading.Tests.MutexTests - add a process-wide implementation of named mutex to CoreCLR on Mono to better compatibility with Mono
System.IO.Pipelines.Tests.CompleteWithLargeWriteThrows

Closes #50871 #50874 #50923 #49937 #114148

@kotlarmilos
Copy link
Member Author

/azp run runtime-extra-platforms

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kotlarmilos
Copy link
Member Author

/azp run runtime-android,runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kotlarmilos
Copy link
Member Author

/azp run runtime-android,runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kotlarmilos
Copy link
Member Author

/azp run runtime-android,runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kotlarmilos
Copy link
Member Author

This PR is ready to be merged.

/cc: @steveisok Build machines run out of disk space without symbol stripping. Enabling symbol stripping makes the app non-debuggable and breaks adb shell run-as access to internal storage where test results are stored. For test infrastructure, we need both: debuggable builds and stripped binaries. I created tracking issue that will be done as follow-up: #115717

@kotlarmilos
Copy link
Member Author

/azp run runtime-android,runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kotlarmilos
Copy link
Member Author

/azp run runtime-android,runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kotlarmilos
Copy link
Member Author

/azp run runtime-android,runtime-androidemulator

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@kotlarmilos kotlarmilos merged commit f9ad7c9 into dotnet:main May 21, 2025
165 of 168 checks passed
@kotlarmilos
Copy link
Member Author

Follow-up work tracked in #114951 and #115717.

SimaTian pushed a commit that referenced this pull request May 27, 2025
* Enable running library tests

* Add jobs to extra-platforms

* Fix System.Runtime tests

* Fix arm64 android coreclr tests

* Add TestUtilities project reference

* Add support for local android test execution on windows

* Disable failing tests on Android devices

* Disable failing tests on Android devices

* Disable failing tests

* Remove unnecessary using System directive

* Disable failing tests

* Disable failing tests

* Fix typo

* Disable failing tests

* Disable ConfigSwitchIsHonored test

* Disable failing tests

* Fix typo

* Enable System.Runtime.Loader.Tests tests

* Enable System.Text.RegularExpressions tests

* Disable failing tests

* Try run disabled tests

* Fix build

* Disable failing tests

* Enable tests that are passing

* Fix typo

* Fix ActiveIssue annotation

* Disable failing tests

* Add comment

* Disable failing tests

* Fix test annotations

* Update ProjectExclusions tracking issue

* Disable failing tests on Android platform

* Skip MutexTests on CoreCLR Android

* Disable tests on CoreCLR Android

* Fix ActiveIssue annotation

* Disable failing tests

* Disable failing tests

* Exclude System.Net.Security.Tests from project builds

* Exclude System.Net.Security.Tests from project builds

* Disable CoreCLR tests on Mono

* Disable System.Net.WebSockets.Tests due to disk space limitation

* Exclude debug symbols

* Update StripDebugSymbols property

* Disable failing tests

* Fix build

* Disable tests

* Disable failing tests

* Test run

* Use Debug config to ensure android:debuggable=true

* Fix StripDebugSymbols

* Fix formatting

* Test run

---------

Co-authored-by: Steve Pfister <stpfiste@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
6 participants