From 69ad98e996d18443e834f201eb2ab5d642a808c5 Mon Sep 17 00:00:00 2001 From: deusebio Date: Fri, 5 Apr 2024 15:23:17 +0200 Subject: [PATCH] [DPE-3857] Test consistency between workload and metadata versions (#186) --- tests/integration/test_charm.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index 4cb520c8..3cd7642d 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -11,7 +11,7 @@ import requests from pytest_operator.plugin import OpsTest -from literals import JMX_EXPORTER_PORT, REL_NAME, SECURITY_PROTOCOL_PORTS +from literals import DEPENDENCIES, JMX_EXPORTER_PORT, REL_NAME, SECURITY_PROTOCOL_PORTS from .helpers import ( APP_NAME, @@ -102,6 +102,12 @@ async def test_build_and_deploy(ops_test: OpsTest, kafka_charm): assert ops_test.model.applications[ZK_NAME].status == "active" +@pytest.mark.abort_on_fail +async def test_consistency_between_workload_and_metadata(ops_test: OpsTest): + application = ops_test.model.applications[APP_NAME] + assert application.data.get("workload-version", "") == DEPENDENCIES["kafka_service"]["version"] + + @pytest.mark.abort_on_fail async def test_remove_zk_relation_relate(ops_test: OpsTest): remove_relation_cmd = f"remove-relation {APP_NAME} {ZK_NAME}"