Add test leg to the PR build to run libraries tests on Android devices (#42209)
authorJo Shields <directhex@apebox.org>
Wed, 21 Oct 2020 16:47:27 +0000 (12:47 -0400)
committerGitHub <noreply@github.com>
Wed, 21 Oct 2020 16:47:27 +0000 (18:47 +0200)
The on-device version of https://github.com/dotnet/runtime/pull/37585

Co-authored-by: Premek Vysoky <premek.vysoky@microsoft.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
eng/pipelines/libraries/helix-queues-setup.yml
eng/pipelines/runtime.yml
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs
src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs

index b18e103..c0e13a2 100644 (file)
@@ -94,6 +94,8 @@ jobs:
     # Android
     - ${{ if in(parameters.platform, 'Android_x86', 'Android_x64') }}:
       - Ubuntu.1804.Amd64.Android.Open
+    - ${{ if in(parameters.platform, 'Android_arm', 'Android_arm64') }}:
+      - Windows.10.Amd64.Android.Open
 
     # iOS x64/x86
     - ${{ if in(parameters.platform, 'iOS_x64', 'iOS_x86') }}:
index 18e500c..fa6522c 100644 (file)
@@ -264,7 +264,6 @@ jobs:
     runtimeFlavor: mono
     platforms:
     - Android_x86
-    - Android_arm64
     - tvOS_x64
     - iOS_arm64
     - iOS_x86
@@ -354,6 +353,7 @@ jobs:
     buildConfig: Release
     runtimeFlavor: mono
     platforms:
+    - Android_arm64
     - Android_x64
     - iOS_x64
     variables:
index fb7db1e..80f824e 100644 (file)
@@ -47,6 +47,9 @@ namespace System
         public static bool IsNotFedoraOrRedHatFamily => !IsFedora && !IsRedHatFamily;
         public static bool IsNotDebian10 => !IsDebian10;
 
+        // Android
+        public static bool IsAndroid => RuntimeInformation.IsOSPlatform(OSPlatform.Create("Android"));
+
         public static bool IsSuperUser => IsBrowser || IsWindows ? false : libc.geteuid() == 0;
 
         public static Version OpenSslVersion => !IsOSXLike && !IsWindows ?
index c52c10c..9244ddf 100644 (file)
@@ -60,7 +60,7 @@ namespace System.IO.FileSystem.DriveInfoTests
         }
 
         [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/runtime/issues/18487
-        [PlatformSpecific(TestPlatforms.AnyUnix)]
+        [PlatformSpecific(TestPlatforms.AnyUnix & ~TestPlatforms.Android)]
         public void PropertiesOfValidDrive()
         {
             var root = new DriveInfo("/");