Skip to content

Commit

Permalink
return tests back
Browse files Browse the repository at this point in the history
  • Loading branch information
siarheivesialou committed Jan 5, 2024
1 parent f25cdc6 commit 619e89e
Showing 1 changed file with 23 additions and 24 deletions.
47 changes: 23 additions & 24 deletions ydb/core/kafka_proxy/ut/ut_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1714,21 +1714,21 @@ Y_UNIT_TEST_SUITE(KafkaProtocol) {

{
// Validate only
// auto msg = client.CreatePartitions({
// TopicToCreate(topic1Name, 11),
// TopicToCreate(topic2Name, 21)
// }, true);
// UNIT_ASSERT_VALUES_EQUAL(msg->Results.size(), 2);
// UNIT_ASSERT_VALUES_EQUAL(msg->Results[0].Name.value(), topic1Name);
// UNIT_ASSERT_VALUES_EQUAL(msg->Results[1].Name.value(), topic2Name);

// auto result0 = pqClient.DescribeTopic(topic1Name, describeTopicSettings).GetValueSync();
// UNIT_ASSERT(result0.IsSuccess());
// UNIT_ASSERT_EQUAL(result0.GetTopicDescription().GetPartitions().size(), 10);

// auto result1 = pqClient.DescribeTopic(topic2Name, describeTopicSettings).GetValueSync();
// UNIT_ASSERT(result1.IsSuccess());
// UNIT_ASSERT_EQUAL(result1.GetTopicDescription().GetPartitions().size(), 20);
auto msg = client.CreatePartitions({
TopicToCreate(topic1Name, 11),
TopicToCreate(topic2Name, 21)
}, true);
UNIT_ASSERT_VALUES_EQUAL(msg->Results.size(), 2);
UNIT_ASSERT_VALUES_EQUAL(msg->Results[0].Name.value(), topic1Name);
UNIT_ASSERT_VALUES_EQUAL(msg->Results[1].Name.value(), topic2Name);

auto result0 = pqClient.DescribeTopic(topic1Name, describeTopicSettings).GetValueSync();
UNIT_ASSERT(result0.IsSuccess());
UNIT_ASSERT_EQUAL(result0.GetTopicDescription().GetPartitions().size(), 10);

auto result1 = pqClient.DescribeTopic(topic2Name, describeTopicSettings).GetValueSync();
UNIT_ASSERT(result1.IsSuccess());
UNIT_ASSERT_EQUAL(result1.GetTopicDescription().GetPartitions().size(), 20);
}

{
Expand All @@ -1739,24 +1739,23 @@ Y_UNIT_TEST_SUITE(KafkaProtocol) {

// Increase partitions number
auto msg = client.CreatePartitions({
TopicToCreate(shortTopic1Name, 11)
// TopicToCreate(topic2Name, 21)
TopicToCreate(shortTopic1Name, 11),
TopicToCreate(shortTopic2Name, 21)
});

// UNIT_ASSERT_VALUES_EQUAL(msg->Results.size(), 2);
UNIT_ASSERT_VALUES_EQUAL(msg->Results.size(), 1);
UNIT_ASSERT_VALUES_EQUAL(msg->Results.size(), 2);
UNIT_ASSERT_VALUES_EQUAL(msg->Results[0].Name.value(), shortTopic1Name);
UNIT_ASSERT_VALUES_EQUAL(msg->Results[0].ErrorCode, NONE_ERROR);
// UNIT_ASSERT_VALUES_EQUAL(msg->Results[1].Name.value(), topic2Name);
// UNIT_ASSERT_VALUES_EQUAL(msg->Results[1].ErrorCode, NONE_ERROR);
UNIT_ASSERT_VALUES_EQUAL(msg->Results[1].Name.value(), shortTopic2Name);
UNIT_ASSERT_VALUES_EQUAL(msg->Results[1].ErrorCode, NONE_ERROR);

auto result1 = pqClient.DescribeTopic(topic1Name, describeTopicSettings).GetValueSync();
UNIT_ASSERT(result1.IsSuccess());
UNIT_ASSERT_EQUAL(result1.GetTopicDescription().GetPartitions().size(), 11);

// auto result2 = pqClient.DescribeTopic(topic2Name, describeTopicSettings).GetValueSync();
// UNIT_ASSERT(result2.IsSuccess());
// UNIT_ASSERT_EQUAL(result2.GetTopicDescription().GetPartitions().size(), 21);
auto result2 = pqClient.DescribeTopic(topic2Name, describeTopicSettings).GetValueSync();
UNIT_ASSERT(result2.IsSuccess());
UNIT_ASSERT_EQUAL(result2.GetTopicDescription().GetPartitions().size(), 21);
}
} // Y_UNIT_TEST(CreateTopicsScenario)

Expand Down

0 comments on commit 619e89e

Please sign in to comment.