From 4e39a0c24f9674ae0375d2eb8addeea359042bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Goinvic?= Date: Thu, 19 Feb 2026 16:23:20 +0100 Subject: [PATCH] Add manifests tests --- tests/manifests/__init__.py | 4 ++++ tests/manifests/test_volumes.py | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tests/manifests/__init__.py b/tests/manifests/__init__.py index 54c0781a..d6e82e1a 100644 --- a/tests/manifests/__init__.py +++ b/tests/manifests/__init__.py @@ -595,6 +595,10 @@ all_components_details = [ "hookshot": ("/bin/matrix-hookshot/App/BridgeApp.js",), }, additional_values_files=("hookshot-encryption-enabled-values.yaml",), + additional_secret_values_files=( + "hookshot-static-registration-externally-test-values.yaml", + "hookshot-static-registration-in-helm-test-values.yaml", + ), ), ComponentDetails( name="matrix-authentication-service", diff --git a/tests/manifests/test_volumes.py b/tests/manifests/test_volumes.py index 355ee9a6..54c67acc 100644 --- a/tests/manifests/test_volumes.py +++ b/tests/manifests/test_volumes.py @@ -35,6 +35,28 @@ async def test_emptyDirs_are_memory(templates): ) +@pytest.mark.parametrize("values_file", values_files_to_test | secret_values_files_to_test) +@pytest.mark.asyncio_cooperative +async def test_volume_names_are_unique(templates): + """Test that volume names are unique within each pod template.""" + for template in templates: + if template["kind"] not in ["Deployment", "StatefulSet", "Job"]: + continue + + volumes = template["spec"]["template"]["spec"].get("volumes", []) + volume_names = [volume["name"] for volume in volumes] + + # Check for duplicates + seen_names = set() + duplicates = [] + for name in volume_names: + if name in seen_names: + duplicates.append(name) + seen_names.add(name) + + assert len(duplicates) == 0, f"{template_id(template)} has duplicate volume names: {duplicates}" + + @pytest.mark.parametrize("values_file", values_files_to_test) @pytest.mark.asyncio_cooperative async def test_extra_volumes(values, make_templates, release_name):