-
Notifications
You must be signed in to change notification settings - Fork 652
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
ListGroups API KIP 848 #1267
base: master
Are you sure you want to change the base?
ListGroups API KIP 848 #1267
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! Looks mostly okay.
Remember to add it to CHANGELOG.md also
|
||
listres, err := a.ListConsumerGroups( | ||
ctx, SetAdminRequestTimeout(time.Second), | ||
SetAdminMatchConsumerGroupTypes([]ConsumerGroupType{classicGroupType, classicGroupType})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SetAdminMatchConsumerGroupTypes([]ConsumerGroupType{classicGroupType, classicGroupType})) | |
SetAdminMatchConsumerGroupTypes([]ConsumerGroupType{classicGroupType, classicGroupType})) |
Why is the same group type included twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is to test the INVALID_ARGS error code with duplicate group types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But your test is not checking for invalid args error code below, so change that. You're checking for deadline exceeded still.
kafka/integration_test.go
Outdated
// Generating a new topic/groupID to ensure a fresh group/topic is created. | ||
rand.Seed(time.Now().Unix()) | ||
groupID := fmt.Sprintf("%s-%d", testconf.GroupID, rand.Int()) | ||
topic := fmt.Sprintf("%s-%d", testconf.TopicName, rand.Int()) | ||
nonExistentGroupID := fmt.Sprintf("%s-nonexistent-%d", testconf.GroupID, rand.Int()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move above the "if" block, and remove from below too, so they're not duplicated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for creation of adminclient, topic creation, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is done voluntarily because currently in semaphore we run the whole tests with broker version < 3.8.0.0 and then when we run with higher broker version on semaphore to test the consumer group protocol we only check the case of consumer group that is why we return at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so since there is nothing common between the tests, why don't you split them? I don't see why we should have an entirely different test in an if block if there's any shared code between them, it just makes it harder to read.
TestAdminClient_ListAndDescribeConsumerGroupsClassic and TestAdminClient_ListConsumerGroupsConsumer
* Upgrade Hamba to 2.24.0 (#2) (#1266) * Upgrade Hamba to 2.24.0 Also enhance CSFLE examples; minor cleanup * Fix imports * Perform Avro schema resolution if necessary (#1) (#1265) * Add missing API parts for schema registry (#1256) * add some missing API parts * fix context endpoint --------- Co-authored-by: Alexander Hein <[email protected]> Co-authored-by: Robert Yokota <[email protected]> * Regenerate SR api docs (#4) (#1268) * Fix some golint naming issues (#6) (#1272) * Fix URL for DeksByVersion (#7) (#1273) * Pinned cp-kafka version (#1270) as 7.7.0 has bug https://issues.apache.org/jira/browse/KAFKA-16310 that makes LisOffsets test fail * Single Commit --------- Co-authored-by: Robert Yokota <[email protected]> Co-authored-by: oleksandrkorzhenevskyi <[email protected]> Co-authored-by: Alexander Hein <[email protected]> Co-authored-by: Emanuele Sabellico <[email protected]>
kafka/adminapi_test.go
Outdated
ctx, cancel := context.WithTimeout(context.Background(), expDuration) | ||
defer cancel() | ||
|
||
listres, err := a.ListConsumerGroups( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gofmt needs to be run
kafka/adminapi_test.go
Outdated
@@ -464,7 +467,10 @@ func testAdminAPIsListConsumerGroups( | |||
t.Fatalf("Expected ConsumerGroupTypeFromString to work for Unknown type") | |||
} | |||
|
|||
listres, err := a.ListConsumerGroups( | |||
ctx, cancel := context.WithTimeout(context.Background(), expDuration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code doesn't run. Are the tests running when you are dynamically linking librdkafka? This is a compilation error because := and not =
|
||
listres, err := a.ListConsumerGroups( | ||
ctx, SetAdminRequestTimeout(time.Second), | ||
SetAdminMatchConsumerGroupTypes([]ConsumerGroupType{classicGroupType, classicGroupType})) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But your test is not checking for invalid args error code below, so change that. You're checking for deadline exceeded still.
kafka/integration_test.go
Outdated
// Generating a new topic/groupID to ensure a fresh group/topic is created. | ||
rand.Seed(time.Now().Unix()) | ||
groupID := fmt.Sprintf("%s-%d", testconf.GroupID, rand.Int()) | ||
topic := fmt.Sprintf("%s-%d", testconf.TopicName, rand.Int()) | ||
nonExistentGroupID := fmt.Sprintf("%s-nonexistent-%d", testconf.GroupID, rand.Int()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so since there is nothing common between the tests, why don't you split them? I don't see why we should have an entirely different test in an if block if there's any shared code between them, it just makes it harder to read.
TestAdminClient_ListAndDescribeConsumerGroupsClassic and TestAdminClient_ListConsumerGroupsConsumer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some more comments, please run the tests
confluent-kafka-go KIP 848 ListGroups APIBranch Name
BuildInstall the corresponding Librdkafka and build with Unit Tests
ClusterSpawn the trivup cluster in Example
Integration TestsRemember to set the Environment Variable |
No description provided.