From 1f270e95a903b78c16f1781915a05af1847247d8 Mon Sep 17 00:00:00 2001
From: Mitchell Hwang <16830051+mdh1418@users.noreply.github.com>
Date: Fri, 3 Sep 2021 13:22:20 -0400
Subject: [PATCH 1/9] [libraries] Skip test suites crashing on CI for
iOS/tvOS/MacCatalyst
---
.../tests/PhysicalFileProviderTests.cs | 3 +-
.../tests/FileSystemWatcher.WaitForChanged.cs | 1 +
.../tests/MemoryMappedViewAccessor.Tests.cs | 4 +-
.../tests/MemoryMappedViewStream.Tests.cs | 4 +-
.../tests/System/EnvironmentTests.cs | 7 +-
.../tests/System/TimeZoneInfoTests.cs | 2 +-
src/libraries/tests.proj | 74 ++++---------------
.../AotCompilerTask/MonoAOTCompiler.props | 3 +-
8 files changed, 28 insertions(+), 70 deletions(-)
diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs
index 8f2b5691fa9f80..4aa57114fcdc69 100644
--- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs
+++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs
@@ -137,7 +137,7 @@ public void PollingFileProviderShouldntConsumeINotifyInstances()
}
}
}
-
+
private void GetFileInfoReturnsNotFoundFileInfoForIllegalPathWithLeadingSlashes(string path)
{
using (var provider = new PhysicalFileProvider(Path.GetTempPath()))
@@ -936,6 +936,7 @@ public void NoopChangeTokenForFilterThatNavigatesAboveRoot()
[Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/58584", TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS)]
public void TokenForEmptyFilter()
{
using (var root = new DisposableFileSystem())
diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.WaitForChanged.cs b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.WaitForChanged.cs
index aec8019cdceb9d..cce5f54469f2dd 100644
--- a/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.WaitForChanged.cs
+++ b/src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.WaitForChanged.cs
@@ -111,6 +111,7 @@ public void NonZeroTimeout_NoEvents_TimesOut(bool enabledBeforeWait)
[InlineData(WatcherChangeTypes.Changed, false)]
[InlineData(WatcherChangeTypes.Renamed, true)]
[InlineData(WatcherChangeTypes.All, true)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/58418", typeof(PlatformDetection), nameof(PlatformDetection.IsMacCatalyst), nameof(PlatformDetection.IsArm64Process))]
public void NonZeroTimeout_NoActivity_TimesOut(WatcherChangeTypes changeType, bool enabledBeforeWait)
{
using (var testDirectory = new TempDirectory(GetTestFilePath()))
diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs
index 8f7e2fae576eb0..0c8517ca4affe8 100644
--- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs
+++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs
@@ -91,10 +91,10 @@ public void ValidAccessLevelCombinations(MemoryMappedFileAccess mapAccess, Memor
}
catch (UnauthorizedAccessException)
{
- if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || PlatformDetection.IsInContainer) &&
+ if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || PlatformDetection.IsInContainer) &&
(viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
{
- // Containers and OSX with SIP enabled do not have execute permissions by default.
+ // Containers and OSXlike platforms with SIP enabled do not have execute permissions by default.
throw new SkipTestException("Insufficient execute permission.");
}
diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs
index d77a24ae0ddfa6..a5340527df9011 100644
--- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs
+++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs
@@ -91,10 +91,10 @@ public void ValidAccessLevelCombinations(MemoryMappedFileAccess mapAccess, Memor
}
catch (UnauthorizedAccessException)
{
- if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || PlatformDetection.IsInContainer) &&
+ if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || PlatformDetection.IsInContainer) &&
(viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
{
- // Containers and OSX with SIP enabled do not have execute permissions by default.
+ // Containers and OSXlike platforms with SIP enabled do not have execute permissions by default.
throw new SkipTestException("Insufficient execute permission.");
}
diff --git a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs
index f2b35eb6c2cdf7..63723f0117a099 100644
--- a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs
+++ b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs
@@ -346,11 +346,8 @@ public void GetFolderPath_Unix_PersonalIsHomeAndUserProfile()
Assert.Equal(Environment.GetEnvironmentVariable("HOME"), Environment.GetFolderPath(Environment.SpecialFolder.Personal));
Assert.Equal(Environment.GetEnvironmentVariable("HOME"), Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
}
- // tvOS effectively doesn't have a HOME
- if (!PlatformDetection.IstvOS)
- {
- Assert.Equal(Environment.GetEnvironmentVariable("HOME"), Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
- }
+
+ Assert.Equal(Environment.GetEnvironmentVariable("HOME"), Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
}
[Theory]
diff --git a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs
index e9f08a9b389dbb..e9a187e0e6b1ae 100644
--- a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs
+++ b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs
@@ -2662,7 +2662,7 @@ public static void IsIanaIdWithNotCacheTest()
}
[ConditionalFact(nameof(SupportIanaNamesConversion))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/52072", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/58440", TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS)]
public static void IsIanaIdTest()
{
bool expected = !s_isWindows;
diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj
index 79e47df5100e6d..d7380dafa130b9 100644
--- a/src/libraries/tests.proj
+++ b/src/libraries/tests.proj
@@ -120,6 +120,7 @@
+
@@ -145,71 +146,27 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
@@ -313,8 +270,9 @@
-
+
+
-
+
+
From 675d34088a6741d4a0ab49a34957c9f02d9ca34f Mon Sep 17 00:00:00 2001
From: Mitchell Hwang <16830051+mdh1418@users.noreply.github.com>
Date: Mon, 6 Sep 2021 05:04:22 -0400
Subject: [PATCH 2/9] [libraries] Restrict ILLink Suppression xml to mobile
platforms (#58519)
Co-authored-by: Mitchell Hwang
---
...raryBuild.xml => ILLink.Suppressions.Mobile.LibraryBuild.xml} | 0
src/libraries/System.Net.Http/src/System.Net.Http.csproj | 1 +
2 files changed, 1 insertion(+)
rename src/libraries/System.Net.Http/src/ILLink/{ILLink.Suppressions.LibraryBuild.xml => ILLink.Suppressions.Mobile.LibraryBuild.xml} (100%)
diff --git a/src/libraries/System.Net.Http/src/ILLink/ILLink.Suppressions.LibraryBuild.xml b/src/libraries/System.Net.Http/src/ILLink/ILLink.Suppressions.Mobile.LibraryBuild.xml
similarity index 100%
rename from src/libraries/System.Net.Http/src/ILLink/ILLink.Suppressions.LibraryBuild.xml
rename to src/libraries/System.Net.Http/src/ILLink/ILLink.Suppressions.Mobile.LibraryBuild.xml
diff --git a/src/libraries/System.Net.Http/src/System.Net.Http.csproj b/src/libraries/System.Net.Http/src/System.Net.Http.csproj
index f6bcf3faacba20..2897f5fb1505fc 100644
--- a/src/libraries/System.Net.Http/src/System.Net.Http.csproj
+++ b/src/libraries/System.Net.Http/src/System.Net.Http.csproj
@@ -35,6 +35,7 @@
+
From 4e2986d0ae44295739c747e6ae83087314e2ec81 Mon Sep 17 00:00:00 2001
From: Mitchell Hwang <16830051+mdh1418@users.noreply.github.com>
Date: Mon, 6 Sep 2021 05:06:38 -0400
Subject: [PATCH 3/9] [Libraries] Fix TimeZoneInfoTests IsIanaIdTest for
iOS/MacCatalyst/tvOS (#58562)
* [Libraries] Fix TimeZoneInfoTests IsIanaIdTest for iOS/MacCatalyst/tvOS
* [Libraries] Fix IsIanaIdTest to assert throw for iOS/MacCatalyst/tvOS
* Readd new line
* [Mobile][Libraries] System.Runtime.Tests TimeZoneInfoTests remove mobile from iana conversion support
* [libraries] System.Runtime.Tests revert IsIanaIdTest iOS tvOS special casing
* Remove active issue added in recently merged PR
Co-authored-by: Mitchell Hwang
---
.../System.Runtime/tests/System/TimeZoneInfoTests.cs | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs
index e9a187e0e6b1ae..c5258a6252fec2 100644
--- a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs
+++ b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs
@@ -2641,7 +2641,7 @@ public static void UsingAlternativeTimeZoneIdsTest(string windowsId, string iana
}
}
- public static bool SupportIanaNamesConversion => PlatformDetection.IsNotBrowser && PlatformDetection.ICUVersion.Major >= 52;
+ public static bool SupportIanaNamesConversion => PlatformDetection.IsNotMobile && PlatformDetection.ICUVersion.Major >= 52;
public static bool SupportIanaNamesConversionAndRemoteExecution => SupportIanaNamesConversion && RemoteExecutor.IsSupported;
// This test is executed using the remote execution because it needs to run before creating the time zone cache to ensure testing with that state.
@@ -2662,7 +2662,6 @@ public static void IsIanaIdWithNotCacheTest()
}
[ConditionalFact(nameof(SupportIanaNamesConversion))]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/58440", TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS)]
public static void IsIanaIdTest()
{
bool expected = !s_isWindows;
@@ -2694,7 +2693,6 @@ public static void IsIanaIdTest()
[InlineData("Argentina Standard Time", "America/Buenos_Aires")]
[InlineData("Newfoundland Standard Time", "America/St_Johns")]
[InlineData("Iran Standard Time", "Asia/Tehran")]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/52072", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public static void IdsConversionsTest(string windowsId, string ianaId)
{
Assert.True(TimeZoneInfo.TryConvertIanaIdToWindowsId(ianaId, out string winId));
@@ -2729,7 +2727,6 @@ public static void IdsConversionsTest(string windowsId, string ianaId)
[InlineData("GMT Standard Time", "Europe/Dublin", "ie")]
[InlineData("W. Europe Standard Time", "Europe/Rome", "it")]
[InlineData("New Zealand Standard Time", "Pacific/Auckland", "nz")]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/52072", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public static void IdsConversionsWithRegionTest(string windowsId, string ianaId, string region)
{
Assert.True(TimeZoneInfo.TryConvertWindowsIdToIanaId(windowsId, region, out string ianaConvertedId));
From 65350e42e4e90e8d5e144a5fe5a509e934ea9ca3 Mon Sep 17 00:00:00 2001
From: Mitchell Hwang <16830051+mdh1418@users.noreply.github.com>
Date: Fri, 27 Aug 2021 07:42:01 -0400
Subject: [PATCH 4/9] [iOS/tvOS] Skip System.Security.Cryptography.Pkcs PNSE,
System.Diagnostics.Tracing and System.Runtime.Extensions test (#58210)
---
.../TestsWriteEventToListener.cs | 1 +
.../SignedCms/SignedCmsTests.netcoreapp.cs | 2 ++
.../tests/CollectionTests.cs | 1 +
.../tests/ExportTests.cs | 2 ++
.../PfxFormatTests.SingleCertGenerator.cs | 1 +
.../tests/PfxFormatTests.cs | 19 +++++++++++++++++++
.../tests/PfxTests.cs | 1 +
7 files changed, 27 insertions(+)
diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs
index d7c7046ab693ed..97470a2ff4450e 100644
--- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs
+++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs
@@ -452,6 +452,7 @@ public void Test_EventSourceCreatedEvents_AfterListener()
[Theory]
[InlineData(true)]
[InlineData(false)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
public void Test_EventListenerThrows_ExceptionIsNotRethrownToCaller(bool setThrowOnEventWriteErrorsFlag)
{
TestUtilities.CheckNoEventSourcesRunning("Start");
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.netcoreapp.cs b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.netcoreapp.cs
index 9d90fe7905550f..cfa17458204e57 100644
--- a/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.netcoreapp.cs
+++ b/src/libraries/System.Security.Cryptography.Pkcs/tests/SignedCms/SignedCmsTests.netcoreapp.cs
@@ -377,6 +377,7 @@ public static void AddAttributeToIndefiniteLengthContent()
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void AddSigner_RSA_EphemeralKey()
{
using (RSA rsa = RSA.Create())
@@ -435,6 +436,7 @@ public static void AddSigner_DSA_EphemeralKey()
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void AddSigner_ECDSA_EphemeralKey()
{
using (ECDsa ecdsa = ECDsa.Create())
diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs
index a519f7a7ccb69b..0392b093e87d7c 100644
--- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs
+++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs
@@ -833,6 +833,7 @@ public static void ExportMultiplePrivateKeys()
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void CanAddMultipleCertsWithSinglePrivateKey()
{
using (var oneWithKey = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, X509KeyStorageFlags.Exportable | Cert.EphemeralIfPossible))
diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs
index 0051bc4da70e67..951a1329b77244 100644
--- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs
+++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ExportTests.cs
@@ -104,6 +104,7 @@ public static void ExportAsPfxVerifyPassword()
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void ExportAsPfxWithPrivateKeyVerifyPassword()
{
using (var cert = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, X509KeyStorageFlags.Exportable))
@@ -124,6 +125,7 @@ public static void ExportAsPfxWithPrivateKeyVerifyPassword()
}
[Fact]
+ [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "The PKCS#12 Exportable flag is not supported on iOS/MacCatalyst/tvOS")]
public static void ExportAsPfxWithPrivateKey()
{
using (X509Certificate2 cert = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, X509KeyStorageFlags.Exportable))
diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.SingleCertGenerator.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.SingleCertGenerator.cs
index de3a5f18004e4e..3fad2b9d3beb08 100644
--- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.SingleCertGenerator.cs
+++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/PfxFormatTests.SingleCertGenerator.cs
@@ -62,6 +62,7 @@ public static IEnumerable