-
Notifications
You must be signed in to change notification settings - Fork 198
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
Added Koperator e2e test - external consumer producer #991
Conversation
efb3ee4
to
4cd451f
Compare
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.
Looks good really, couple of small nitpicks
tests/e2e/kafka_prod_consum_test.go
Outdated
// requireExternalProducerConsumer deploys a kafkaTopic into the K8s cluster | ||
// and produces, consumes messages and makes comparison between the produced and consumed messages. | ||
func requireExternalProducerConsumer(kubectlOptions *k8s.KubectlOptions) { | ||
When("Externally produce and consume message to Kafka cluster", Ordered, func() { |
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.
When("Externally produce and consume message to Kafka cluster", Ordered, func() { | |
When("Externally produce and consume message to and from the Kafka cluster", Ordered, func() { |
tests/e2e/kafka_prod_consum_test.go
Outdated
|
||
for i := range messages { | ||
record := &kgo.Record{Topic: topicName, Value: []byte(messages[i])} | ||
// Exists at the first error occurrence |
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.
// Exists at the first error occurrence | |
// Exits at the first error occurrence |
tests/e2e/kafka_prod_consum_test.go
Outdated
// This check may fail when the topic is re-created and has some undeleted content. | ||
Expect(consumedMessages).Should(HaveLen(1)) |
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.
Do we need this check in this case? We might end up reusing stuff in the end. Instead we could just compare with the last message from what we consumed here I think.
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.
Will we actually run into this case that " the topic is re-created and has some undeleted content" in the test environment? If not, I think it's better to remove that comment to avoid confusions
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.
Ok I will remove it.
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.
fixed: 0e03f84
tests/e2e/kafka_prod_consum_test.go
Outdated
} | ||
|
||
// requireExternalProducingConsumingMessage gets the Kafka cluster external addresses from the kafkaCluster CR status | ||
// when externalAddresses is not specified and producing, consuming messages and make comparison between them. |
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.
// when externalAddresses is not specified and producing, consuming messages and make comparison between them. | |
// when externalAddresses is not specified. It also produces and consumes messages and makes a comparison between them. |
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.
fixed: 0e03f84
b905456
to
56b6b8a
Compare
4cd451f
to
3071ef6
Compare
1a732a8
to
46b2d71
Compare
d029f87
to
0e03f84
Compare
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.
looking sharp
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.
Looks good!
tests/e2e/kafka.go
Outdated
kafkaTopicTemplate, | ||
map[string]interface{}{ | ||
"Name": topicName, | ||
"TopicName": topicName, | ||
"Namespace": kubectlOptions.Namespace, | ||
}, | ||
) | ||
err := waitK8sResourceCondition(kubectlOptions, kafkaTopicKind, "jsonpath={.status.state}=created", defaultTopicCreationWaitTime, "", topicName) | ||
Expect(err).ShouldNot(HaveOccurred()) |
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 still think we should refactor these later on to be the same across our code base, but I don't think this should block merging now.
Description
Adding basic end to end tests for Koperator.
Included tests:
Type of Change
Checklist