Skip to content

Commit

Permalink
Skip test if dns not configured
Browse files Browse the repository at this point in the history
Signed-off-by: averevki <[email protected]>
  • Loading branch information
averevki committed Sep 16, 2024
1 parent 30e3677 commit c27efe5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions testsuite/tests/multicluster/load_balanced/conftest.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit c27efe5

Please sign in to comment.