Skip to content

HDDS-14562. Test if proto 3 SCM request can be parsed by proto 2#9729

Open
Russole wants to merge 1 commit intoapache:masterfrom
Russole:HDDS-14562
Open

HDDS-14562. Test if proto 3 SCM request can be parsed by proto 2#9729
Russole wants to merge 1 commit intoapache:masterfrom
Russole:HDDS-14562

Conversation

@Russole
Copy link
Contributor

@Russole Russole commented Feb 7, 2026

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.

  • Added testProto3RequestCanBeParsedByProto2 to verify that requests encoded with proto3 can be successfully parsed by the legacy proto2 schema.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14562

How was this patch tested?

Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

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

@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());
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants