1+ import os
12import unittest
23import pandas as pd
34from kafka import KafkaProducer , KafkaConsumer
@@ -184,6 +185,13 @@ def test_kafka(self):
184185 import json
185186
186187 KAFKA_SERVER = "localhost:19092"
188+ PIPELINE_TO_KAFKA_SERVER = "redpanda:9092"
189+
190+ in_ci = os .environ .get ("IN_CI" )
191+
192+ if in_ci == "1" :
193+ # if running in CI, skip the test
194+ return
187195
188196 print ("(Re-)creating topics..." )
189197 admin_client = KafkaAdminClient (
@@ -224,7 +232,6 @@ def test_kafka(self):
224232 sql .register_table (TABLE_NAME , SQLSchema ({"id" : "INT NOT NULL PRIMARY KEY" }))
225233 sql .register_view (VIEW_NAME , f"SELECT COUNT(*) as num_rows FROM { TABLE_NAME } " )
226234
227- PIPELINE_TO_KAFKA_SERVER = "redpanda:9092"
228235
229236 source_config = {
230237 "topics" : [INPUT_TOPIC ],
@@ -281,10 +288,16 @@ def test_http_get(self):
281288 def test_avro_format (self ):
282289 from feldera .formats import AvroFormat
283290
284- KAFKA_URL_FROM_PIPELINE = "redpanda:9092"
291+ PIPELINE_TO_KAFKA_SERVER = "redpanda:9092"
285292 KAFKA_SERVER = "localhost:19092"
286293 TOPIC = "test_avro_format"
287294
295+ in_ci = os .environ .get ("IN_CI" )
296+
297+ if in_ci == "1" :
298+ # if running in CI, skip the test
299+ return
300+
288301 admin_client = KafkaAdminClient (
289302 bootstrap_servers = KAFKA_SERVER ,
290303 client_id = "test_client"
@@ -305,7 +318,7 @@ def test_avro_format(self):
305318
306319 sink_config = {
307320 "topic" : TOPIC ,
308- "bootstrap.servers" : KAFKA_URL_FROM_PIPELINE ,
321+ "bootstrap.servers" : PIPELINE_TO_KAFKA_SERVER ,
309322 "auto.offset.reset" : "earliest" ,
310323 }
311324
0 commit comments