HDDS-14562. Test if proto 3 SCM request can be parsed by proto 2#9729
Open
Russole wants to merge 1 commit intoapache:masterfrom
Open
HDDS-14562. Test if proto 3 SCM request can be parsed by proto 2#9729Russole wants to merge 1 commit intoapache:masterfrom
Russole wants to merge 1 commit intoapache:masterfrom
Conversation
szetszwo
reviewed
Feb 7, 2026
Contributor
There was a problem hiding this comment.
@Russole , thanks for working on this!
- Let's add a test for RequestType as below
@Test
public void testRequestType() {
for (Proto2SCMRatisProtocolForTesting.RequestType proto2 : Proto2SCMRatisProtocolForTesting.RequestType.values()) {
final SCMRatisProtocol.RequestType proto3 = SCMRatisProtocol.RequestType.valueOf(proto2.name());
assertEquals(proto3.getNumber(), proto2.getNumber());
assertEquals(proto3.toString(), proto2.toString());
}
}-
Also, let's make the tests to run with random values. For proto2-to-proto3 tests, see https://issues.apache.org/jira/secure/attachment/13080703/TestSCMRatisProtocolCompatibility.java
-
Could you add similar proto3-to-proto2 tests?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
HDDS-10481 introduced TestSCMRatisProtocolCompatibility with a test verifying that proto2 requests can be parsed by proto3.
This JIRA extends that coverage by adding the reverse test, ensuring that proto3 requests can also be parsed by proto2.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14562
How was this patch tested?