2Plugin that imports the required fixtures to start the broker.
10from testsuite.databases.kafka.classes
import BootstrapServers
13 'testsuite.databases.kafka.pytest_plugin',
14 'pytest_userver.plugins.core',
21@pytest.fixture(scope='session')
22def _patched_bootstrap_servers_internal() -> BootstrapServers:
23 """Used for internal testing purposes"""
25 brokers_list = os.getenv(
'KAFKA_RECIPE_BROKER_LIST')
27 return brokers_list.split(
',')
35@pytest.fixture(scope='session')
38 Should contain manually listed names of kafka producer and consumer
41 @ingroup userver_testsuite_fixtures
47@pytest.fixture(scope='session')
50 Automatically generates secdist config from user static config.
51 `_bootstrap_servers` is testsuite's fixture that determines current
52 bootstrap servers list depends on Kafka testsuite plugin's settings.
54 @snippet samples/kafka_service/testsuite/conftest.py Kafka service sample - secdist
56 @ingroup userver_testsuite_fixtures
60 'brokers': _bootstrap_servers,
64 logging.info(f
'Kafka brokers are: {single_setting["brokers"]}')
67 'kafka_settings': {component_name: single_setting
for component_name
in kafka_components},