2Plugin that imports the required fixtures to start the broker.
11from testsuite.databases.kafka.classes
import BootstrapServers
14 'testsuite.databases.kafka.pytest_plugin',
15 'pytest_userver.plugins.core',
22@pytest.fixture(scope='session')
23def _patched_bootstrap_servers_internal() -> BootstrapServers:
24 """Used for internal testing purposes"""
26 brokers_list = os.getenv(
'KAFKA_RECIPE_BROKER_LIST')
28 return brokers_list.split(
',')
36@pytest.fixture(scope='session')
39 Should contain manually listed names of kafka producer and consumer
42 @ingroup userver_testsuite_fixtures
48@pytest.fixture(scope='session')
51 Automatically generates secdist config from user static config.
52 `_bootstrap_servers` is testsuite's fixture that determines current
53 bootstrap servers list depends on Kafka testsuite plugin's settings.
55 @snippet samples/kafka_service/testsuite/conftest.py Kafka service sample - secdist
57 @ingroup userver_testsuite_fixtures
61 'brokers': _bootstrap_servers,
65 logging.info(f
'Kafka brokers are: {single_setting["brokers"]}')
68 'kafka_settings': {component_name: single_setting
for component_name
in kafka_components},