Add end-to-end integration testing for all compression types
This commit is contained in:
@@ -6,10 +6,17 @@ from test.testutil import random_string
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
|
@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
|
||||||
def test_end_to_end(kafka_broker):
|
@pytest.mark.parametrize("compression", [None, 'gzip', 'snappy', 'lz4'])
|
||||||
|
def test_end_to_end(kafka_broker, compression):
|
||||||
|
|
||||||
|
# LZ4 requires 0.8.2
|
||||||
|
if compression == 'lz4' and version() < (0, 8, 2):
|
||||||
|
return
|
||||||
|
|
||||||
connect_str = 'localhost:' + str(kafka_broker.port)
|
connect_str = 'localhost:' + str(kafka_broker.port)
|
||||||
producer = KafkaProducer(bootstrap_servers=connect_str,
|
producer = KafkaProducer(bootstrap_servers=connect_str,
|
||||||
max_block_ms=10000,
|
max_block_ms=10000,
|
||||||
|
compression_type=compression,
|
||||||
value_serializer=str.encode)
|
value_serializer=str.encode)
|
||||||
consumer = KafkaConsumer(bootstrap_servers=connect_str,
|
consumer = KafkaConsumer(bootstrap_servers=connect_str,
|
||||||
group_id=None,
|
group_id=None,
|
||||||
|
|||||||
Reference in New Issue
Block a user