Skip to content

Commit dfa0e45

Browse files
Merge pull request #1659 from SixLabors/af/update-RemoteExecutor
Update RemoteExecutor
2 parents 381dff8 + 255802c commit dfa0e45

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

tests/Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<PackageReference Update="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" Condition="'$(IsWindows)'=='true'" />
2323
<PackageReference Update="Colourful" Version="2.0.5" />
2424
<PackageReference Update="Magick.NET-Q16-AnyCPU" Version="7.23.2.1" />
25-
<PackageReference Update="Microsoft.DotNet.RemoteExecutor" Version="6.0.0-beta.20513.1" />
26-
<PackageReference Update="Microsoft.DotNet.XUnitExtensions" Version="6.0.0-beta.20513.1" />
25+
<PackageReference Update="Microsoft.DotNet.RemoteExecutor" Version="6.0.0-beta.21311.3" />
26+
<PackageReference Update="Microsoft.DotNet.XUnitExtensions" Version="6.0.0-beta.21311.3" />
2727
<PackageReference Update="Moq" Version="4.14.6" />
2828
<PackageReference Update="Pfim" Version="0.9.1" />
2929
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Version="5.8.64" Condition="'$(IsOSX)'=='true'" />

tests/ImageSharp.Tests/Processing/Processors/Convolution/BokehBlurTest.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using SixLabors.ImageSharp.Processing;
1212
using SixLabors.ImageSharp.Processing.Processors.Convolution;
1313
using SixLabors.ImageSharp.Tests.TestUtilities;
14+
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
1415
using Xunit;
1516
using Xunit.Abstractions;
1617

@@ -154,8 +155,9 @@ public void BokehBlurFilterProcessor_WorksWithAllPixelTypes<TPixel>(TestImagePro
154155
appendSourceFileOrDescription: false);
155156

156157
[Theory]
157-
[WithFileCollection(nameof(TestFiles), nameof(BokehBlurValues), PixelTypes.Rgba32)]
158-
public void BokehBlurFilterProcessor_Bounded(TestImageProvider<Rgba32> provider, BokehBlurInfo value)
158+
[WithFileCollection(nameof(TestFiles), nameof(BokehBlurValues), PixelTypes.Rgba32, HwIntrinsics.AllowAll)]
159+
[WithFileCollection(nameof(TestFiles), nameof(BokehBlurValues), PixelTypes.Rgba32, HwIntrinsics.DisableSSE41)]
160+
public void BokehBlurFilterProcessor_Bounded(TestImageProvider<Rgba32> provider, BokehBlurInfo value, HwIntrinsics intrinsicsFilter)
159161
{
160162
static void RunTest(string arg1, string arg2)
161163
{
@@ -173,12 +175,13 @@ static void RunTest(string arg1, string arg2)
173175
x.BokehBlur(value.Radius, value.Components, value.Gamma, bounds);
174176
},
175177
testOutputDetails: value.ToString(),
178+
ImageComparer.TolerantPercentage(0.05f),
176179
appendPixelTypeToFileName: false);
177180
}
178181

179182
FeatureTestRunner.RunWithHwIntrinsicsFeature(
180183
RunTest,
181-
HwIntrinsics.DisableSSE41,
184+
intrinsicsFilter,
182185
provider,
183186
value);
184187
}

tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using System;
55
using System.IO;
6-
6+
using Microsoft.DotNet.RemoteExecutor;
77
using SixLabors.ImageSharp.Formats;
88
using SixLabors.ImageSharp.Formats.Bmp;
99
using SixLabors.ImageSharp.Formats.Gif;
@@ -114,5 +114,20 @@ public void GetReferenceDecoder_ReturnsCorrectDecoders_Linux(string fileName, Ty
114114
IImageDecoder decoder = TestEnvironment.GetReferenceDecoder(fileName);
115115
Assert.IsType(expectedDecoderType, decoder);
116116
}
117+
118+
// RemoteExecutor does not work with "dotnet xunit" used to run tests on 32 bit .NET Framework:
119+
// https://github.com/SixLabors/ImageSharp/blob/381dff8640b721a34b1227c970fcf6ad6c5e3e72/ci-test.ps1#L30
120+
public static bool IsNot32BitNetFramework = !TestEnvironment.IsFramework || TestEnvironment.Is64BitProcess;
121+
122+
[ConditionalFact(nameof(IsNot32BitNetFramework))]
123+
public void RemoteExecutor_FailingRemoteTestShouldFailLocalTest()
124+
{
125+
static void FailingCode()
126+
{
127+
Assert.False(true);
128+
}
129+
130+
Assert.ThrowsAny<RemoteExecutionException>(() => RemoteExecutor.Invoke(FailingCode).Dispose());
131+
}
117132
}
118133
}

0 commit comments

Comments
 (0)