Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 26, 2025

The System.Security.Cryptography.OpenSsl.Tests were running locally on macOS and Android when developers executed ./build.sh -rc release -s libs.tests -test, even though these tests will always fail due to the removal of OpenSSL compatibility from Apple platforms and Android.

While the tests were already excluded from CI builds via the IgnoreForCI condition in the project file, they would still run (and fail) in local development environments on these platforms.

This change adds an AssemblyInfo.cs file to the OpenSsl tests project with an assembly-level SkipOnPlatform attribute:

[assembly: SkipOnPlatform(TestPlatforms.OSX | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst | TestPlatforms.Android, 
    "OpenSSL is not supported on Apple platforms and Android")]

Additionally, the IgnoreForCI condition in the project file has been updated to include MacCatalyst, ensuring consistency between the CI exclusions and the runtime test skipping.

This ensures that when tests are run locally on any of these platforms, the entire test assembly is skipped with a clear message explaining why. The solution follows the same pattern used by other libraries in the codebase (such as System.IO.Pipes and System.Net.Security).

The tests continue to run normally on Linux and other supported platforms where OpenSSL is available.

Fixes #118865.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 26, 2025
Copilot AI and others added 2 commits August 26, 2025 17:07
Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Copilot AI changed the title [WIP] System.Security.Cryptography.OpenSsl.Tests shouldn't run on macOS Skip System.Security.Cryptography.OpenSsl.Tests on Apple platforms Aug 26, 2025
Copilot finished work on behalf of akoeplinger August 26, 2025 17:10
Copilot AI requested a review from akoeplinger August 26, 2025 17:10
Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Copilot AI changed the title Skip System.Security.Cryptography.OpenSsl.Tests on Apple platforms Skip System.Security.Cryptography.OpenSsl.Tests on Apple platforms and Android Aug 26, 2025
Copilot AI requested a review from akoeplinger August 26, 2025 17:39
Copilot finished work on behalf of akoeplinger August 26, 2025 17:39
Co-authored-by: akoeplinger <1376924+akoeplinger@users.noreply.github.com>
Copilot finished work on behalf of akoeplinger August 26, 2025 18:00
Copilot AI requested a review from akoeplinger August 26, 2025 18:00
@akoeplinger akoeplinger added area-System.Security test-enhancement Improvements of test source code and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 26, 2025
@akoeplinger akoeplinger requested a review from vcsjones August 26, 2025 18:01
@akoeplinger akoeplinger marked this pull request as ready for review August 26, 2025 18:01
Copilot AI review requested due to automatic review settings August 26, 2025 18:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the developer experience by ensuring that System.Security.Cryptography.OpenSsl.Tests are properly skipped on platforms where OpenSSL is not supported, rather than running and failing. The change addresses the issue where tests would run locally on macOS and Android despite being excluded from CI builds.

Key changes:

  • Adds assembly-level platform skipping for unsupported platforms using Xunit's SkipOnPlatform attribute
  • Updates CI exclusion conditions to include MacCatalyst for consistency

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/libraries/System.Security.Cryptography.OpenSsl/tests/System.Security.Cryptography.OpenSsl.Tests.csproj Added MacCatalyst to the IgnoreForCI condition
src/libraries/System.Security.Cryptography.OpenSsl/tests/AssemblyInfo.cs New file with assembly-level SkipOnPlatform attribute for unsupported platforms

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@vcsjones
Copy link
Member

@copilot the new file you added, AssemblyInfo.cs, is not in System.Security.Cryptography.OpenSsl.Tests.csproj so it won't be included as part of compilation. Can you please add this file to the top of the <ItemGroup> that includes source files?

Co-authored-by: vcsjones <361677+vcsjones@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 26, 2025

@copilot the new file you added, AssemblyInfo.cs, is not in System.Security.Cryptography.OpenSsl.Tests.csproj so it won't be included as part of compilation. Can you please add this file to the top of...

Added AssemblyInfo.cs to the compilation ItemGroup at the top of the source files section. The file is now properly included in the build. (12fdcdd)

Copilot finished work on behalf of vcsjones August 26, 2025 18:37
@vcsjones vcsjones enabled auto-merge (squash) August 26, 2025 19:07
@vcsjones vcsjones merged commit a139bfe into main Aug 26, 2025
88 checks passed
@bartonjs bartonjs deleted the copilot/fix-118865 branch August 26, 2025 21:12
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Security test-enhancement Improvements of test source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Security.Cryptography.OpenSsl.Tests shouldn't run on macOS

3 participants