Skip to content

Remove kafka tests.#67

Merged
slinkydeveloper merged 1 commit intomainfrom
remove-kafka
Apr 7, 2026
Merged

Remove kafka tests.#67
slinkydeveloper merged 1 commit intomainfrom
remove-kafka

Conversation

@slinkydeveloper
Copy link
Copy Markdown
Collaborator

We don't need per SDK coverage, these tests primarily test a runtime feature already largely covered by the e2e tests.

Copy link
Copy Markdown
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning up our sdk-test-suite @slinkydeveloper. I am wondering whether we should move the removed tests to the e2e test suite as the Kafka tests there seem to test slightly different aspects.

Comment on lines -68 to -145
@Test
@Execution(ExecutionMode.CONCURRENT)
fun handleEventInCounterService(
@InjectAdminURI adminURI: URI,
@InjectContainerPort(hostName = "kafka", port = KafkaContainer.KAFKA_EXTERNAL_PORT)
kafkaPort: Int,
@InjectClient ingressClient: Client
) = runTest {
val counter = UUID.randomUUID().toString()

// Create subscription
val subscriptionsClient =
SubscriptionApi(ApiClient().setHost(adminURI.host).setPort(adminURI.port))
subscriptionsClient.createSubscription(
CreateSubscriptionRequest()
.source("kafka://my-cluster/$COUNTER_TOPIC")
.sink("service://${CounterHandlers.Metadata.SERVICE_NAME}/add")
.options(mapOf("auto.offset.reset" to "earliest")))

// Produce message to kafka
produceMessageToKafka(
"PLAINTEXT://localhost:$kafkaPort",
COUNTER_TOPIC,
listOf(counter to "1", counter to "2", counter to "3"))

await withAlias
"Updates from Kafka are visible in the counter" untilAsserted
{
assertThat(CounterClient.fromClient(ingressClient, counter).get()).isEqualTo(6L)
}
}

@Test
@Execution(ExecutionMode.CONCURRENT)
fun handleEventInEventHandler(
@InjectAdminURI adminURI: URI,
@InjectContainerPort(hostName = "kafka", port = KafkaContainer.KAFKA_EXTERNAL_PORT)
kafkaPort: Int,
@InjectClient ingressClient: Client
) = runTest {
val counter = UUID.randomUUID().toString()

// Create subscription
val subscriptionsClient =
SubscriptionApi(ApiClient().setHost(adminURI.host).setPort(adminURI.port))
subscriptionsClient.createSubscription(
CreateSubscriptionRequest()
.source("kafka://my-cluster/$EVENT_HANDLER_TOPIC")
.sink("service://${ProxyHandlers.Metadata.SERVICE_NAME}/oneWayCall")
.options(mapOf("auto.offset.reset" to "earliest")))

// Produce message to kafka
produceMessageToKafka(
"PLAINTEXT://localhost:$kafkaPort",
EVENT_HANDLER_TOPIC,
listOf(
null to
Json.encodeToString(
ProxyRequest(
CounterHandlers.Metadata.SERVICE_NAME,
counter,
"add",
Json.encodeToString(1).encodeToByteArray())),
null to
Json.encodeToString(
ProxyRequest(
CounterHandlers.Metadata.SERVICE_NAME,
counter,
"add",
Json.encodeToString(2).encodeToByteArray())),
null to
Json.encodeToString(
ProxyRequest(
CounterHandlers.Metadata.SERVICE_NAME,
counter,
"add",
Json.encodeToString(3).encodeToByteArray())),
))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it make sense to move those tests to the e2e repo? We seem to test workflows and tracing in the e2e tests but not handleEventInEventHandler and not explicitly handleEventInCounterService.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Its' here part of this restatedev/e2e#404

We don't need per SDK coverage, these tests primarily test a runtime feature already largely covered by the e2e tests.
@slinkydeveloper slinkydeveloper merged commit 0fc60eb into main Apr 7, 2026
3 checks passed
@slinkydeveloper slinkydeveloper deleted the remove-kafka branch April 7, 2026 16:54
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants