1919 */
2020package org.jetbrains.kotlinx.spark.api
2121
22+ import io.kotest.core.Tag
2223import io.kotest.core.spec.style.ShouldSpec
2324import io.kotest.matchers.collections.shouldBeIn
2425import org.apache.kafka.clients.consumer.ConsumerConfig
@@ -33,39 +34,14 @@ import org.apache.spark.streaming.kafka010.LocationStrategies
3334import org.jetbrains.kotlinx.spark.api.tuples.*
3435import java.io.Serializable
3536
37+ object Kafka : Tag()
38+
3639class KafkaStreamingTest : ShouldSpec ({
37- context("kafka") {
3840
39- // val kafka = install(
40- // TestContainerExtension(KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:6.2.1")))
41- // ) {
42- // withEmbeddedZookeeper()
43- // }
44- //
45- // should("support kafka streams") {
46- // val topic1 = "test1"
47- // val topic2 = "test2"
48- //
49- // val producer = kafka.createStringStringProducer()
50- // producer.send(ProducerRecord(topic1, "Hello this is a test test test"))
51- // producer.send(ProducerRecord(topic1, "Hello this is a test test test"))
52- // producer.send(ProducerRecord(topic1, "Hello this is a test test test"))
53- // producer.send(ProducerRecord(topic1, "Hello this is a test test test"))
54- // producer.send(ProducerRecord(topic2, "This is also also a test test something"))
55- // producer.send(ProducerRecord(topic2, "This is also also a test test something"))
56- // producer.send(ProducerRecord(topic2, "This is also also a test test something"))
57- // producer.send(ProducerRecord(topic2, "This is also also a test test something"))
58- // producer.close()
59- //
60- // val consumer = kafka.createStringStringConsumer {
61- // this[ConsumerConfig.MAX_POLL_RECORDS_CONFIG] = 1
62- // }
63- //
64- // consumer.subscribe(listOf(topic1))
65- // val records = consumer.poll(Duration.ofSeconds(100))
66- // records.shouldHaveSize(4)
67- // records.print()
41+ // making sure it can be skipped on github actions since it times out
42+ tags(Kafka )
6843
44+ context("kafka") {
6945 val port = 9092
7046 val broker = " localhost:$port "
7147 val topic1 = " test1"
0 commit comments