Skip to content

Fix color checking from blocking and add logging#27400

Merged
PureWeen merged 2 commits intomainfrom
fix_device_tests_add_logging
Jan 31, 2025
Merged

Fix color checking from blocking and add logging#27400
PureWeen merged 2 commits intomainfrom
fix_device_tests_add_logging

Conversation

@PureWeen
Copy link
Copy Markdown
Member

@PureWeen PureWeen commented Jan 28, 2025

Description of Change

  • Wire up ILogger so we can more easily see where time is being spent if we need to
  • Fix all the "ContainsColor" methods to validate on a background thread. In theory tests should timeout if they've been running longer than 15 seconds but the contains color call was blocking the UIThread so it couldn't process the timeout
  • Change the image on the shell tab test to use a smaller image so it doesn't have to validate against as many pixels

Copilot AI review requested due to automatic review settings January 28, 2025 12:09
@PureWeen PureWeen requested a review from a team as a code owner January 28, 2025 12:09
@PureWeen PureWeen added this to the .NET 9 SR4 milestone Jan 28, 2025
var uiimage = Assert.IsType<UIImage>(drawable.Value);

uiimage.AssertContainsColor(expectedColor.ToPlatform());
await uiimage.AssertContainsColor(expectedColor.ToPlatform()).ConfigureAwait(false);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the same changes are required on the Android tests:

D:\a\_work\1\s\src\Core\tests\DeviceTests\Services\ImageSource\FontImageSourceServiceTests.Android.cs(56,4): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Core\tests\DeviceTests\Core.DeviceTests.csproj::TargetFramework=net9.0-android]
D:\a\_work\1\s\src\Core\tests\DeviceTests\Services\ImageSource\FontImageSourceServiceTests.Android.cs(95,4): error CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [D:\a\_work\1\s\src\Core\tests\DeviceTests\Core.DeviceTests.csproj::TargetFramework=net9.0-android]
    8944 Warning(s)
    2 Error(s)

@PureWeen PureWeen force-pushed the fix_device_tests_add_logging branch from cff2cf6 to 824260d Compare January 28, 2025 22:12
@PureWeen PureWeen force-pushed the fix_device_tests_add_logging branch from 824260d to 4e05295 Compare January 29, 2025 16:08
@PureWeen
Copy link
Copy Markdown
Member Author

@PureWeen PureWeen merged commit b2654b2 into main Jan 31, 2025
@PureWeen PureWeen deleted the fix_device_tests_add_logging branch January 31, 2025 17:19
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2025
@PureWeen PureWeen review requested due to automatic review settings March 23, 2026 21:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants