Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor SLH-DSA tests #114981

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

Merged

Conversation

PranavSenthilnathan
Copy link
Member

Old inheritance hierarchy was too complicated and test were running multiple times for no reason. This PR refactors the test to have:

  • SlhDsaContractTests - tests SlhDsa instance methods with mock derived class
  • SlhDsaFactoryTests - tests SlhDsa static methods
  • SlhDsaTests - base class for all the tests that require an implementation of SLH-DSA
    • SlhDsaImplementationTests
    • SlhDsaOpenSslTests
  • SlhDsaOpenSslConstructionTests

@PranavSenthilnathan PranavSenthilnathan self-assigned this Apr 23, 2025
@Copilot Copilot AI review requested due to automatic review settings April 23, 2025 22:52
Copy link
Contributor

@Copilot 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 refactors the SLH-DSA tests to simplify the inheritance hierarchy and reduce duplicate test execution. Key changes include reorganizing tests into separate classes (e.g. SlhDsaContractTests, SlhDsaFactoryTests, SlhDsaOpenSslTests), removing redundant or legacy test base classes, and updating test code style with modern collection initialization syntax.

Reviewed Changes

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

File Description
src/libraries/System.Security.Cryptography/tests/SlhDsaOpenSslTests.cs Introduces tests for OpenSSL-specific SLH-DSA functionality using modern collection initialization.
src/libraries/System.Security.Cryptography/tests/SlhDsaOpenSslConstructionTests.Unix.cs Refactors the construction tests into a static class with static test methods.
src/libraries/System.Security.Cryptography/tests/SlhDsaOpenSslConstructionTests.NotSupported.cs Refactors the unsupported platform tests and removes unused inheritance.
src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/SlhDsa/*.cs Removes legacy test base classes and reorganizes tests into dedicated files (e.g., SlhDsaContractTests, SlhDsaFactoryTests), while integrating updated API validations and buffer checks.
Files not reviewed (2)
  • src/libraries/Microsoft.Bcl.Cryptography/tests/Microsoft.Bcl.Cryptography.Tests.csproj: Language not supported
  • src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj: Language not supported

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.

Copy link
Member

@bartonjs bartonjs left a comment

Choose a reason for hiding this comment

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

I found added equivalents of everything that was removed; so just need to get the comments resolved one way or another then good to go.

@PranavSenthilnathan PranavSenthilnathan merged commit 5314b8c into dotnet:main Apr 24, 2025
80 of 85 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants