Changeset View
Changeset View
Standalone View
Standalone View
swh/journal/tests/conftest.py
Show First 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | |||||
def kafka_consumer_group(kafka_prefix: str): | def kafka_consumer_group(kafka_prefix: str): | ||||
"""Pick a random consumer group for kafka consumers on each call""" | """Pick a random consumer group for kafka consumers on each call""" | ||||
return "test-consumer-%s" % kafka_prefix | return "test-consumer-%s" % kafka_prefix | ||||
TEST_CONFIG = { | TEST_CONFIG = { | ||||
'consumer_id': 'swh.journal.consumer', | 'consumer_id': 'swh.journal.consumer', | ||||
'object_types': OBJECT_TYPE_KEYS.keys(), | 'object_types': OBJECT_TYPE_KEYS.keys(), | ||||
'max_messages': 1, # will read 1 message and stops | 'stop_after_objects': 1, # will read 1 object and stop | ||||
'storage': {'cls': 'memory', 'args': {}}, | 'storage': {'cls': 'memory', 'args': {}}, | ||||
} | } | ||||
@pytest.fixture | @pytest.fixture | ||||
def test_config(kafka_server: Tuple[Popen, int], | def test_config(kafka_server: Tuple[Popen, int], | ||||
kafka_prefix: str): | kafka_prefix: str): | ||||
"""Test configuration needed for producer/consumer | """Test configuration needed for producer/consumer | ||||
Show All 37 Lines |