From faa0a4552da28a2f95d12a7436c8485021ec6679 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 10 Aug 2021 00:25:52 -0400 Subject: [PATCH 1/7] Disable System.Drawing.Common tests for mobile workloads Since the library is PNSE by default, make sure the tests do not run on mobile. --- .../tests/System.Drawing.Common.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj index 1b9175f3eb5e1..014cf3b7d7711 100644 --- a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj +++ b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj @@ -3,7 +3,7 @@ true true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;net48 - true + true From f3cfb1d9217313fd8b36b4d8b118ac23afc4071f Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 10 Aug 2021 07:38:53 -0400 Subject: [PATCH 2/7] Shorter condition --- .../tests/System.Drawing.Common.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj index 014cf3b7d7711..ca1116cd5ad54 100644 --- a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj +++ b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj @@ -3,7 +3,7 @@ true true $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;net48 - true + true From 33d157a7aa0012358dea793ffe7ef3bea7700544 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 10 Aug 2021 09:13:52 -0400 Subject: [PATCH 3/7] Remove condition that prevents the GenerateRuntimeConfig target from running for mobile tests --- eng/testing/tests.mobile.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 572213ee2c783..d264a9aadc44b 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -54,7 +54,7 @@ AssemblyFile="$(RuntimeConfigParserTasksAssemblyPath)" Condition="'$(RuntimeConfigParserTasksAssemblyPath)' != ''" /> - + $(PublishDir)$(AssemblyName).runtimeconfig.json $(PublishDir)runtimeconfig.bin From 409a979b549c9e2da88ea18149c7a2a1cfead8b1 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 10 Aug 2021 11:38:28 -0400 Subject: [PATCH 4/7] Properly skip some tests that were failing on CI --- .../tests/UnitTests/ConsoleLifetimeExitTests.cs | 3 ++- src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs index ab803145a4387..40c861abf3824 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs @@ -93,7 +93,8 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) /// [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] // SIGTERM is only handled on net6.0+, so the workaround to "clobber" the exit code is still in place on NetFramework - [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] + [SkipOnMono("ThreadPoolBoundHandle.BindHandle is not supported by Mono on Windows", TestPlatforms.Windows)] public void EnsureEnvironmentExitCode() { using var remoteHandle = RemoteExecutor.Invoke(async () => diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs index e4f52b617096a..02d8d394182bb 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs @@ -500,7 +500,7 @@ public void HasExited_GetNotStarted_ThrowsInvalidOperationException() } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")] public void Kill_NotStarted_ThrowsInvalidOperationException() { var process = new Process(); From a792aac7a3db44c3fedae9e7ff1aeed55b8a212a Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 10 Aug 2021 18:01:07 -0400 Subject: [PATCH 5/7] Go with santi's suggestion. --- .../tests/TestUtilities/System/PlatformDetection.cs | 6 +++++- .../tests/UnitTests/ConsoleLifetimeExitTests.cs | 1 + .../System.Diagnostics.Process/tests/ProcessTests.cs | 7 ++++--- src/libraries/System.Runtime/tests/System/CharTests.cs | 8 ++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index d44f9bcfdd661..9582b95ad4310 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -97,7 +97,11 @@ public static bool IsDrawingSupported #if NETCOREAPP if (!IsWindows) { - if (IsOSX) + if (IsMobile) + { + return false; + } + else if (IsOSX) { return NativeLibrary.TryLoad("libgdiplus.dylib", out _); } diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs index 40c861abf3824..c99758a09b3ff 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs @@ -127,6 +127,7 @@ await Task.Run(() => /// Tests that calling Environment.Exit from the "main" thread doesn't hang the process forever. /// [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] + [SkipOnMono("ThreadPoolBoundHandle.BindHandle is not supported by Mono on Windows", TestPlatforms.Windows)] public void EnsureEnvironmentExitDoesntHang() { using var remoteHandle = RemoteExecutor.Invoke(async () => diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs index 02d8d394182bb..1508a0d7f0602 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs @@ -185,15 +185,14 @@ public void ProcessStart_UseShellExecuteFalse_FilenameIsUrl_ThrowsWin32Exception } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")] public void ProcessStart_TryOpenFolder_UseShellExecuteIsFalse_ThrowsWin32Exception() { Assert.Throws(() => Process.Start(new ProcessStartInfo { UseShellExecute = false, FileName = Path.GetTempPath() })); } [Fact] - [SkipOnPlatform(TestPlatforms.OSX, "OSX doesn't support throwing on Process.Start")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/52882", TestPlatforms.MacCatalyst)] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")] public void TestStartWithBadWorkingDirectory() { string program; @@ -231,6 +230,7 @@ public void TestStartWithBadWorkingDirectory() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasWindowsShell))] [OuterLoop("Launches File Explorer")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")] public void ProcessStart_UseShellExecute_OnWindows_OpenMissingFile_Throws() { string fileToOpen = Path.Combine(Environment.CurrentDirectory, "_no_such_file.TXT"); @@ -243,6 +243,7 @@ public void ProcessStart_UseShellExecute_OnWindows_OpenMissingFile_Throws() [InlineData(true)] [InlineData(false)] [OuterLoop("Launches File Explorer")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")] public void ProcessStart_UseShellExecute_OnWindows_DoesNotThrow(bool isFolder) { string fileToOpen; diff --git a/src/libraries/System.Runtime/tests/System/CharTests.cs b/src/libraries/System.Runtime/tests/System/CharTests.cs index c495bc1ab6d18..72b6a1ee3570b 100644 --- a/src/libraries/System.Runtime/tests/System/CharTests.cs +++ b/src/libraries/System.Runtime/tests/System/CharTests.cs @@ -1089,8 +1089,12 @@ public static IEnumerable UpperLowerCasing_TestData() if (PlatformDetection.IsNotInvariantGlobalization) { - yield return new object[] { '\u0131', 'I', "tr-TR" }; - yield return new object[] { 'i', '\u0130', "tr-TR" }; + // Android has issues w/ tr-TR + if (!PlatformDetection.IsAndroid) + { + yield return new object[] { '\u0131', 'I', "tr-TR" }; + yield return new object[] { 'i', '\u0130', "tr-TR" }; + } yield return new object[] { '\u0660', '\u0660', "en-US" }; } } From ce7e54b403c90d4e36ecdb97c7ede518dc909c9c Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 11 Aug 2021 00:03:01 -0400 Subject: [PATCH 6/7] Skip platform specific test --- .../System.Diagnostics.Process/tests/ProcessTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs index 1508a0d7f0602..880da43a64653 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs @@ -171,14 +171,14 @@ public void TestExited_SynchronizingObject(bool invokeRequired) } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")] public void ProcessStart_TryExitCommandAsFileName_ThrowsWin32Exception() { Assert.Throws(() => Process.Start(new ProcessStartInfo { UseShellExecute = false, FileName = "exit", Arguments = "42" })); } [Fact] - [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS, or tvOS.")] + [SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst, "Not supported on iOS, tvOS, or MacCatalyst.")] public void ProcessStart_UseShellExecuteFalse_FilenameIsUrl_ThrowsWin32Exception() { Assert.Throws(() => Process.Start(new ProcessStartInfo { UseShellExecute = false, FileName = "https://www.github.com/corefx" })); From 09fea57f7b329b7e9014456077bef67b5fed002a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 12 Aug 2021 16:13:32 +0200 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: Eric Erhardt --- .../tests/UnitTests/ConsoleLifetimeExitTests.cs | 4 ++-- src/libraries/System.Runtime/tests/System/CharTests.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs index c99758a09b3ff..5cc91dc9c33f6 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/ConsoleLifetimeExitTests.cs @@ -94,7 +94,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] // SIGTERM is only handled on net6.0+, so the workaround to "clobber" the exit code is still in place on NetFramework [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] - [SkipOnMono("ThreadPoolBoundHandle.BindHandle is not supported by Mono on Windows", TestPlatforms.Windows)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public void EnsureEnvironmentExitCode() { using var remoteHandle = RemoteExecutor.Invoke(async () => @@ -127,7 +127,7 @@ await Task.Run(() => /// Tests that calling Environment.Exit from the "main" thread doesn't hang the process forever. /// [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] - [SkipOnMono("ThreadPoolBoundHandle.BindHandle is not supported by Mono on Windows", TestPlatforms.Windows)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public void EnsureEnvironmentExitDoesntHang() { using var remoteHandle = RemoteExecutor.Invoke(async () => diff --git a/src/libraries/System.Runtime/tests/System/CharTests.cs b/src/libraries/System.Runtime/tests/System/CharTests.cs index 72b6a1ee3570b..cd4de327b6151 100644 --- a/src/libraries/System.Runtime/tests/System/CharTests.cs +++ b/src/libraries/System.Runtime/tests/System/CharTests.cs @@ -1089,7 +1089,7 @@ public static IEnumerable UpperLowerCasing_TestData() if (PlatformDetection.IsNotInvariantGlobalization) { - // Android has issues w/ tr-TR + // Android has issues w/ tr-TR, see https://github.com/dotnet/runtime/issues/37069 if (!PlatformDetection.IsAndroid) { yield return new object[] { '\u0131', 'I', "tr-TR" };