From c27efe5ded84be650b045e91c9a2066d3bc367f7 Mon Sep 17 00:00:00 2001 From: averevki Date: Mon, 16 Sep 2024 15:13:07 +0200 Subject: [PATCH] Skip test if dns not configured Signed-off-by: averevki --- testsuite/tests/multicluster/load_balanced/conftest.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/multicluster/load_balanced/conftest.py b/testsuite/tests/multicluster/load_balanced/conftest.py index d4823eb2..c70b9ce3 100644 --- a/testsuite/tests/multicluster/load_balanced/conftest.py +++ b/testsuite/tests/multicluster/load_balanced/conftest.py @@ -1,15 +1,19 @@ """Conftest for load-balanced multicluster tests""" import pytest +from dynaconf import ValidationError from testsuite.kuadrant.policy.dns import DNSPolicy, LoadBalancing @pytest.fixture(scope="package") -def dns_config(testconfig): +def dns_config(testconfig, skip_or_fail): """Configuration for DNS tests""" - testconfig.validators.validate(only="dns") - return testconfig["dns"] + try: + testconfig.validators.validate(only="dns") + return testconfig["dns"] + except ValidationError as exc: + return skip_or_fail(f"DNS configuration is missing: {exc}") @pytest.fixture(scope="package")