From 13d4fb28ad8cf5c21c174df5a9670f9f58ed2e86 Mon Sep 17 00:00:00 2001 From: Iman Enami Date: Mon, 28 Sep 2026 11:58:41 +0400 Subject: [PATCH] ci: use kafka 4 for kafka tests --- tests/integration/test_kafka.py | 40 +++++++++------------------- tests/spread/test_kafka.py/task.yaml | 5 ++-- 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/tests/integration/test_kafka.py b/tests/integration/test_kafka.py index 3f99af5c..100bec1e 100644 --- a/tests/integration/test_kafka.py +++ b/tests/integration/test_kafka.py @@ -16,7 +16,6 @@ KAFKA, KAFKA_EXTRA_USER_ROLES, TOPIC_NAME, - ZOOKEEPER, ) from .helpers import check_logs, fetch_action_get_credentials, fetch_action_kafka @@ -50,38 +49,23 @@ async def test_deploy(ops_test: OpsTest, app_charm: PosixPath, data_integrator_c @pytest.mark.abort_on_fail async def test_deploy_and_relate_kafka(ops_test: OpsTest, cloud_name: str): """Test the relation with Kafka and the correct production and consumption of messagges.""" - await asyncio.gather( - ops_test.model.deploy( - ZOOKEEPER[cloud_name], - channel="3/edge", - application_name=ZOOKEEPER[cloud_name], - num_units=1, - series="jammy", - ), - ops_test.model.deploy( - KAFKA[cloud_name], - channel="3/edge", - application_name=KAFKA[cloud_name], - num_units=1, - series="jammy", - ), + await ops_test.model.deploy( + KAFKA[cloud_name], + channel="4/edge", + application_name=KAFKA[cloud_name], + num_units=1, + series="noble", + config={"roles": "broker,controller"}, + trust=True, ) - await ops_test.model.wait_for_idle(apps=[ZOOKEEPER[cloud_name]], timeout=1000, status="active") - await ops_test.model.wait_for_idle(apps=[KAFKA[cloud_name]], timeout=1000, status="blocked") - - await ops_test.model.add_relation(KAFKA[cloud_name], ZOOKEEPER[cloud_name]) - async with ops_test.fast_forward(fast_interval="60s"): - await ops_test.model.wait_for_idle( - apps=[KAFKA[cloud_name], ZOOKEEPER[cloud_name]], - timeout=2000, - idle_period=30, - status="active", - ) + await ops_test.model.wait_for_idle( + apps=[KAFKA[cloud_name]], timeout=1000, status="active", raise_on_error=False + ) await ops_test.model.add_relation(KAFKA[cloud_name], DATA_INTEGRATOR) await ops_test.model.wait_for_idle( - apps=[KAFKA[cloud_name], ZOOKEEPER[cloud_name], DATA_INTEGRATOR], + apps=[KAFKA[cloud_name], DATA_INTEGRATOR], timeout=2000, idle_period=30, status="active", diff --git a/tests/spread/test_kafka.py/task.yaml b/tests/spread/test_kafka.py/task.yaml index e537e018..e3d1051a 100644 --- a/tests/spread/test_kafka.py/task.yaml +++ b/tests/spread/test_kafka.py/task.yaml @@ -1,7 +1,8 @@ summary: test_kafka.py -# TODO: re-enable once the test moves to Kafka 4 -manual: true environment: TEST_MODULE: test_kafka.py execute: | tox run -e integration -- "tests/integration/$TEST_MODULE" --controller "$CONTROLLER_NAME" --model testing +variants: + - -juju29_k8s + - -juju29_lxd