def kafka_server(service_account, kafka_client: client.KafkaClient): service_options = { "service": { "name": config.SERVICE_NAME, "service_account": service_account["name"], "service_account_secret": service_account["secret"], "security": { "transport_encryption": { "enabled": True } }, } } sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME) try: sdk_install.install( config.PACKAGE_NAME, service_name=config.SERVICE_NAME, expected_running_tasks=config.DEFAULT_TASK_COUNT, additional_options=service_options, timeout_seconds=30 * 60, ) kafka_client.connect(config.DEFAULT_BROKER_COUNT) kafka_client.create_topic(config.DEFAULT_TOPIC_NAME) kafka_client.check_topic_partition_count( config.DEFAULT_TOPIC_NAME, config.DEFAULT_PARTITION_COUNT) yield {**service_options, **{"package_name": config.PACKAGE_NAME}} finally: sdk_install.uninstall(config.PACKAGE_NAME, config.SERVICE_NAME)
def test_topic_delete_overlay(kafka_client: client.KafkaClient): kafka_client.check_topic_deletion(config.EPHEMERAL_TOPIC_NAME) kafka_client.check_topic_partition_count(config.EPHEMERAL_TOPIC_NAME, config.DEFAULT_PARTITION_COUNT)
def test_topic_partition_count(kafka_client: client.KafkaClient): kafka_client.check_topic_creation(config.DEFAULT_TOPIC_NAME) kafka_client.check_topic_partition_count(config.DEFAULT_TOPIC_NAME, config.DEFAULT_PARTITION_COUNT)