Skip to content

Commit

Permalink
Merge pull request Kuadrant#411 from pehala/fix_exposer_scope
Browse files Browse the repository at this point in the history
De-scope exposer fixture for TLS tests
  • Loading branch information
pehala authored May 27, 2024
2 parents f29c0eb + 7fe9838 commit b880f5d
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions testsuite/tests/kuadrant/authorino/operator/tls/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from testsuite.openshift import Selector
from testsuite.gateway import Exposer
from testsuite.gateway.envoy.tls import TLSEnvoy
from testsuite.gateway.exposers import KindExposer
from testsuite.gateway.exposers import KindExposer, OpenShiftExposer
from testsuite.openshift.secret import TLSSecret
from testsuite.utils import cert_builder

Expand Down Expand Up @@ -180,15 +180,32 @@ def gateway(
return envoy


@pytest.fixture(scope="session")
def exposer(exposer) -> Exposer:
@pytest.fixture(scope="module")
def exposer(request, testconfig, hub_openshift) -> Exposer:
"""Exposer object instance with TLS passthrough"""
if isinstance(exposer, KindExposer):
pytest.skip("TLS tests dont work with Kind")
if testconfig["default_exposer"] == KindExposer:
pytest.skip("TLS tests do not work on Kind")
exposer = OpenShiftExposer(hub_openshift)
request.addfinalizer(exposer.delete)
exposer.commit()
exposer.passthrough = True
return exposer


@pytest.fixture(scope="module")
def base_domain(exposer):
"""Returns preconfigured base domain"""
return exposer.base_domain


@pytest.fixture(scope="module")
def wildcard_domain(base_domain):
"""
Wildcard domain of openshift cluster
"""
return f"*.{base_domain}"


@pytest.fixture(scope="module")
def authorino_parameters(authorino_parameters, authorino_cert, create_secret):
"""Setup TLS for authorino"""
Expand Down

0 comments on commit b880f5d

Please sign in to comment.