From 46f47eb97b2dac86f9b79f4eaed2c8c2c0e026ce Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 21 Nov 2020 00:26:38 +0000 Subject: [PATCH] Use higher tolerance on macOS CI runs --- .../Processing/Processors/Transforms/ResizeTests.cs | 3 ++- tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index f40b8d11a..daf217a5a 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -35,7 +35,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms nameof(KnownResamplers.Lanczos5), }; - private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.07F); + private static readonly ImageComparer ValidatorComparer = + ImageComparer.TolerantPercentage(TestEnvironment.IsOSX && TestEnvironment.RunsOnCI ? 0.2595F : 0.07F); [Fact] public void Resize_PixelAgnostic() diff --git a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs index 48728faf0..b80a29646 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs @@ -108,6 +108,8 @@ namespace SixLabors.ImageSharp.Tests internal static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + internal static bool IsOSX => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + internal static bool IsMono => Type.GetType("Mono.Runtime") != null; // https://stackoverflow.com/a/721194 internal static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);