Skip to content
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

don't run drawing tests on Mono #111208

Merged
merged 2 commits into from
Jan 9, 2025
Merged

Conversation

adamsitnik
Copy link
Member

In #107553 a group of tests was failing because Bitmap is not supported on Mono.

System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests.ValidateAgainstBlobs [FAIL]
      System.TypeInitializationException : The type initializer for 'System.Drawing.DrawingCom' threw an exception.
      ---- System.PlatformNotSupportedException : Operation is not supported on this platform.
      Stack Trace:
           at System.Drawing.Bitmap..ctor(Stream stream, Boolean useIcm)
           at System.Drawing.Bitmap..ctor(Stream stream)

The code was already using a guard for that:

https://github.com/dotnet/runtime/blob/06a6ea78fbe99fd86f2f46df9b046cb4c4ea18a7/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTestData.cs#L1346-L1349

I decided to update the logic behind PlatformDetection.IsDrawingSupported as I assumed it's simply not supported and could help in other places. But I need a confirmation from @matouskozak or someone else from the Mono team.

fixes #107553

@adamsitnik adamsitnik added test-enhancement Improvements of test source code binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it area-System.Formats.Nrbf labels Jan 8, 2025
@adamsitnik adamsitnik requested a review from matouskozak January 8, 2025 18:18
@adamsitnik
Copy link
Member Author

/azp run runtime-extra-platforms

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM

System.Drawing depends on ComWrappers that are not supported on Mono.

@adamsitnik adamsitnik merged commit 0e03405 into dotnet:main Jan 9, 2025
116 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Formats.Nrbf binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it test-enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mono] Windows x64 Mono job BinaryFormatterTests exception
2 participants