Hi Guys,
Loving the sarama Library!
Looking for some information on unit testing the sarama ConsumerGroup.
Any help or direction would be greatly appreciated!
Thanks
Hey,
What do you mean by unit testing sarama ConsumerGroup. Sarama already does that. Need more information to answer this question.
Sorry, I should rather phrase this as - I am looking for information on how to test a ConsumerGroup implementation - For example: what is the best way to go about testing the consumergroup implementation in the sarama examples directory?
Update on this? Looking to do the same
I ended up creating a mock struct which implemented the ConsumerGroupClaim interface and pre-populating the messages read chan with test data if that helps. As far as I remember it ended up being a lot of test code for what I was doing.
Maybe using testify/mock pkg could help but I am yet to experiment with it, if anyone could share a best practice for this I'd be grateful :)
@damiannolan : I would like to do the same, could you post a sample snippet of how you did this so it could help the community. Thanks a bunch
Hi,
I copied the code of ExampleConsumerGroup from consumer_group_test.go , and tried to feed the broker address from NewMockBroker to NewClient. Unfortunately, it ends up to timeout panic. Looks like the consumer group cannot fetch from the MockBroker?
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur.
Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.
Most helpful comment
Sorry, I should rather phrase this as - I am looking for information on how to test a ConsumerGroup implementation - For example: what is the best way to go about testing the consumergroup implementation in the sarama examples directory?