-
-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Dependencies #1378
Update Dependencies #1378
Changes from 17 commits
6fed5f6
feb4435
aeb1c1c
d51b725
e94f879
631b578
94ba508
75cfa35
179563d
bd59569
2a1587e
1ea5e98
ceb6dd5
c061218
abbf9e7
e74c901
65b1996
314e9f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<RunSettings> | ||
<RunConfiguration> | ||
<!--Used in conjunction with ActiveIssueAttribute to skip tests with known issues--> | ||
<TestCaseFilter>category!=failing</TestCaseFilter> | ||
</RunConfiguration> | ||
</RunSettings> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,22 +39,40 @@ public class BmpDecoderTests | |
}; | ||
|
||
[Theory] | ||
[WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32, false)] | ||
[WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32, true)] | ||
public void BmpDecoder_CanDecode_MiscellaneousBitmaps<TPixel>(TestImageProvider<TPixel> provider, bool enforceDiscontiguousBuffers) | ||
[WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32)] | ||
public void BmpDecoder_CanDecode_MiscellaneousBitmaps<TPixel>(TestImageProvider<TPixel> provider) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
using Image<TPixel> image = provider.GetImage(BmpDecoder); | ||
image.DebugSave(provider); | ||
|
||
if (TestEnvironment.IsWindows) | ||
{ | ||
image.CompareToOriginal(provider); | ||
} | ||
} | ||
|
||
[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)] | ||
[Theory] | ||
[WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32)] | ||
public void BmpDecoder_CanDecode_MiscellaneousBitmaps_WithLimitedAllocatorBufferCapacity<TPixel>( | ||
TestImageProvider<TPixel> provider) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
// dotnet xunit doesn't respect filter. | ||
if (TestEnvironment.IsFramework) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are keeping Is this something we can easily get with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know. Originally I wanted to do it via setup-dotnet but choosing the platform architecture there is not supported and no-one seems interested in the feature There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure the x86 SDKs are installed by default. |
||
{ | ||
return; | ||
} | ||
|
||
static void RunTest(string providerDump, string nonContiguousBuffersStr) | ||
{ | ||
TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump); | ||
|
||
if (!string.IsNullOrEmpty(nonContiguousBuffersStr)) | ||
{ | ||
provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100); | ||
} | ||
provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100); | ||
|
||
using Image<TPixel> image = provider.GetImage(BmpDecoder); | ||
image.DebugSave(provider, testOutputDetails: nonContiguousBuffersStr); | ||
image.DebugSave(provider, nonContiguousBuffersStr); | ||
|
||
if (TestEnvironment.IsWindows) | ||
{ | ||
|
@@ -66,7 +84,7 @@ static void RunTest(string providerDump, string nonContiguousBuffersStr) | |
RemoteExecutor.Invoke( | ||
RunTest, | ||
providerDump, | ||
enforceDiscontiguousBuffers ? "Disco" : string.Empty) | ||
"Disco") | ||
.Dispose(); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,20 +195,27 @@ public void GifDecoder_DegenerateMemoryRequest_ShouldTranslateTo_ImageFormatExce | |
Assert.IsType<InvalidMemoryOperationException>(ex.InnerException); | ||
} | ||
|
||
[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)] | ||
[Theory] | ||
[WithFile(TestImages.Gif.Giphy, PixelTypes.Rgba32)] | ||
[WithFile(TestImages.Gif.Kumin, PixelTypes.Rgba32)] | ||
public void GifDecoder_CanDecode_WithLimitedAllocatorBufferCapacity<TPixel>(TestImageProvider<TPixel> provider) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
// dotnet xunit doesn't respect filter. | ||
if (TestEnvironment.IsFramework) | ||
{ | ||
return; | ||
} | ||
|
||
static void RunTest(string providerDump, string nonContiguousBuffersStr) | ||
{ | ||
TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump); | ||
|
||
provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100); | ||
|
||
using Image<TPixel> image = provider.GetImage(GifDecoder); | ||
image.DebugSave(provider); | ||
image.DebugSave(provider, nonContiguousBuffersStr); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good catch |
||
image.CompareToOriginal(provider); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,20 +14,38 @@ public partial class JpegDecoderTests | |
public const string DecodeProgressiveJpegOutputName = "DecodeProgressiveJpeg"; | ||
|
||
[Theory] | ||
[WithFileCollection(nameof(ProgressiveTestJpegs), PixelTypes.Rgba32, false)] | ||
[WithFile(TestImages.Jpeg.Progressive.Progress, PixelTypes.Rgba32, true)] | ||
public void DecodeProgressiveJpeg<TPixel>(TestImageProvider<TPixel> provider, bool enforceDiscontiguousBuffers) | ||
[WithFileCollection(nameof(ProgressiveTestJpegs), PixelTypes.Rgba32)] | ||
public void DecodeProgressiveJpeg<TPixel>(TestImageProvider<TPixel> provider) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
using Image<TPixel> image = provider.GetImage(JpegDecoder); | ||
image.DebugSave(provider); | ||
|
||
provider.Utility.TestName = DecodeProgressiveJpegOutputName; | ||
image.CompareToReferenceOutput( | ||
GetImageComparer(provider), | ||
provider, | ||
appendPixelTypeToFileName: false); | ||
} | ||
|
||
[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)] | ||
[Theory] | ||
[WithFile(TestImages.Jpeg.Progressive.Progress, PixelTypes.Rgba32)] | ||
public void DecodeProgressiveJpeg_WithLimitedAllocatorBufferCapacity<TPixel>(TestImageProvider<TPixel> provider) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
// dotnet xunit doesn't respect filter. | ||
if (TestEnvironment.IsFramework) | ||
{ | ||
return; | ||
} | ||
|
||
static void RunTest(string providerDump, string nonContiguousBuffersStr) | ||
{ | ||
TestImageProvider<TPixel> provider = | ||
BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump); | ||
|
||
if (!string.IsNullOrEmpty(nonContiguousBuffersStr)) | ||
{ | ||
provider.LimitAllocatorBufferCapacity().InBytesSqrt(200); | ||
} | ||
provider.LimitAllocatorBufferCapacity().InBytesSqrt(200); | ||
|
||
using Image<TPixel> image = provider.GetImage(JpegDecoder); | ||
image.DebugSave(provider, nonContiguousBuffersStr); | ||
|
@@ -44,7 +62,7 @@ static void RunTest(string providerDump, string nonContiguousBuffersStr) | |
RemoteExecutor.Invoke( | ||
RunTest, | ||
providerDump, | ||
enforceDiscontiguousBuffers ? "Disco" : string.Empty) | ||
"Disco") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We no longer need the parameter I guess. |
||
.Dispose(); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,10 +129,10 @@ public async Task DecodeAsnc_DegenerateMemoryRequest_ShouldTranslateTo_ImageForm | |
[Theory] | ||
[InlineData(TestImages.Jpeg.Baseline.Jpeg420Small, 0)] | ||
[InlineData(TestImages.Jpeg.Issues.ExifGetString750Transform, 1)] | ||
[InlineData(TestImages.Jpeg.Issues.ExifGetString750Transform, 10)] | ||
[InlineData(TestImages.Jpeg.Issues.ExifGetString750Transform, 15)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test was flaky on NET Core 2.1, this seemed to make it less so. |
||
[InlineData(TestImages.Jpeg.Issues.ExifGetString750Transform, 30)] | ||
[InlineData(TestImages.Jpeg.Issues.BadRstProgressive518, 1)] | ||
[InlineData(TestImages.Jpeg.Issues.BadRstProgressive518, 10)] | ||
[InlineData(TestImages.Jpeg.Issues.BadRstProgressive518, 15)] | ||
[InlineData(TestImages.Jpeg.Issues.BadRstProgressive518, 30)] | ||
public async Task Decode_IsCancellable(string fileName, int cancellationDelayMs) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,21 +138,10 @@ public void Serialize(IXunitSerializationInfo info) | |
public void BokehBlurFilterProcessor<TPixel>(TestImageProvider<TPixel> provider, BokehBlurInfo value) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
static void RunTest(string providerDump, string infoDump) | ||
{ | ||
TestImageProvider<TPixel> provider = | ||
BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump); | ||
BokehBlurInfo value = BasicSerializer.Deserialize<BokehBlurInfo>(infoDump); | ||
|
||
provider.RunValidatingProcessorTest( | ||
x => x.BokehBlur(value.Radius, value.Components, value.Gamma), | ||
testOutputDetails: value.ToString(), | ||
appendPixelTypeToFileName: false); | ||
} | ||
|
||
RemoteExecutor | ||
.Invoke(RunTest, BasicSerializer.Serialize(provider), BasicSerializer.Serialize(value)) | ||
.Dispose(); | ||
provider.RunValidatingProcessorTest( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This, and below tests were remote executed to reduce memory pressure, and the chance of OOM-s, especially on x86. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They seem to be ok now. As I recall it uses less memory than it did originally. Haven't seen any failures in the last few test runs due to this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely rock solid. Multiple test runs with zero issues. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok for now then, but if we'll see OOM-s after introducing new 32bit targets, this is a good place to get back. Note that we were getting OOM-s not because of a specific test but rather because of reaching a critical mass of memory intentse-tests. I also pushed some Jpeg tests out-process together with the Bokeh ones back in the past. The price is execution time OFC. Testing image-processing is hard :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preach! |
||
x => x.BokehBlur(value.Radius, value.Components, value.Gamma), | ||
testOutputDetails: value.ToString(), | ||
appendPixelTypeToFileName: false); | ||
} | ||
|
||
[Theory] | ||
|
@@ -164,45 +153,25 @@ static void RunTest(string providerDump, string infoDump) | |
public void BokehBlurFilterProcessor_WorksWithAllPixelTypes<TPixel>(TestImageProvider<TPixel> provider) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
static void RunTest(string providerDump) | ||
{ | ||
TestImageProvider<TPixel> provider = | ||
BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump); | ||
provider.RunValidatingProcessorTest( | ||
provider.RunValidatingProcessorTest( | ||
x => x.BokehBlur(8, 2, 3), | ||
appendSourceFileOrDescription: false); | ||
} | ||
|
||
RemoteExecutor | ||
.Invoke(RunTest, BasicSerializer.Serialize(provider)) | ||
.Dispose(); | ||
} | ||
|
||
[Theory] | ||
[WithFileCollection(nameof(TestFiles), nameof(BokehBlurValues), PixelTypes.Rgba32)] | ||
public void BokehBlurFilterProcessor_Bounded<TPixel>(TestImageProvider<TPixel> provider, BokehBlurInfo value) | ||
where TPixel : unmanaged, IPixel<TPixel> | ||
{ | ||
static void RunTest(string providerDump, string infoDump) | ||
{ | ||
TestImageProvider<TPixel> provider = | ||
BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump); | ||
BokehBlurInfo value = BasicSerializer.Deserialize<BokehBlurInfo>(infoDump); | ||
|
||
provider.RunValidatingProcessorTest( | ||
x => | ||
{ | ||
Size size = x.GetCurrentSize(); | ||
var bounds = new Rectangle(10, 10, size.Width / 2, size.Height / 2); | ||
x.BokehBlur(value.Radius, value.Components, value.Gamma, bounds); | ||
}, | ||
testOutputDetails: value.ToString(), | ||
appendPixelTypeToFileName: false); | ||
} | ||
|
||
RemoteExecutor | ||
.Invoke(RunTest, BasicSerializer.Serialize(provider), BasicSerializer.Serialize(value)) | ||
.Dispose(); | ||
provider.RunValidatingProcessorTest( | ||
x => | ||
{ | ||
Size size = x.GetCurrentSize(); | ||
var bounds = new Rectangle(10, 10, size.Width / 2, size.Height / 2); | ||
x.BokehBlur(value.Radius, value.Components, value.Gamma, bounds); | ||
}, | ||
testOutputDetails: value.ToString(), | ||
appendPixelTypeToFileName: false); | ||
} | ||
|
||
[Theory] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we adding this only because of
ActiveIssueAttribute
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, I see it's not a trivial feature because of the optional
TargetFrameworkMonikers
parameter. Cool 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's pretty nifty. Some cool other attributes available also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not actually needed now but keeping it as it's far too useful!