Skip to content

Commit

Permalink
[Testing, CI] Increased threshold value to make Resizetizer unit test…
Browse files Browse the repository at this point in the history
…s pass on arm64 machines (#27684)

* Increased threshold value to make some tests pass on arm64 machines

* Update SkiaSharpScenarioTests.cs

* [ci] Run build in arm64 or x64 machines

---------

Co-authored-by: Rui Marinho <[email protected]>
  • Loading branch information
anandhan-rajagopal and rmarinho authored Feb 11, 2025
1 parent 4e7ff9d commit 804a549
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion eng/pipelines/handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ parameters:
vmImage: $(macOSXVmImage)
demands:
- macOS.Name -equals Sonoma
- macOS.Architecture -equals x64
artifact: build-macos

- name: PackPlatforms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void Scenario(string scenarioName)
}

// file existed, compare
ImageAssert.Equivalent(bmp.SKImage, expectedImagePath, GetErrorsImageDirectory(), 0);
ImageAssert.Equivalent(bmp.SKImage, expectedImagePath, GetErrorsImageDirectory(), 0.07);
}

private static string ProjectRoot =>
Expand Down
4 changes: 2 additions & 2 deletions src/SingleProject/Resizetizer/test/UnitTests/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class BaseTest : IDisposable
{
private const string TestFolderName = "Microsoft.Maui.Resizetizer.Tests";
private const string TestImagesFolderName = "imageresults";
private const double ImageErrorThreshold = 0.0027;
private const double ImageErrorThreshold = 0.27;

private readonly string DeleteDirectory;
protected readonly string DestinationDirectory;
Expand Down Expand Up @@ -143,7 +143,7 @@ void AssertFileMatchesReal(string actualFilename, object[] args = null, [CallerM

Output.WriteLine($"Validating image similarity with diff dir:{diffDir}");

ImageAssert.Equivalent(actualFilename, expectedFilename, diffDir);
ImageAssert.Equivalent(actualFilename, expectedFilename, diffDir, ImageErrorThreshold);
}
}

Expand Down

0 comments on commit 804a549

Please sign in to comment.