From 5f9ea18b054ed484d7c534f4463b83bdb548a295 Mon Sep 17 00:00:00 2001 From: phala Date: Wed, 10 Apr 2024 13:06:07 +0200 Subject: [PATCH] Override Gateway for metrics tests - It edits Authorino, which is now session -> need to descope gateway to module --- .../kuadrant/authorino/metrics/conftest.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testsuite/tests/kuadrant/authorino/metrics/conftest.py b/testsuite/tests/kuadrant/authorino/metrics/conftest.py index 9bcc64b8..b35cf88f 100644 --- a/testsuite/tests/kuadrant/authorino/metrics/conftest.py +++ b/testsuite/tests/kuadrant/authorino/metrics/conftest.py @@ -5,6 +5,7 @@ import pytest from openshift_client import selector +from testsuite.gateway.envoy import Envoy from testsuite.openshift.config_map import ConfigMap from testsuite.openshift.metrics import ServiceMonitor, MetricsEndpoint, Prometheus @@ -37,6 +38,22 @@ def prometheus(request, openshift): return pytest.skip("Skipping metrics tests as query route is not properly configured") +@pytest.fixture(scope="module") +def gateway(request, authorino, openshift, blame, label, testconfig) -> Envoy: + """Deploys Envoy that wires up the Backend behind the reverse-proxy and Authorino instance""" + gw = Envoy( + openshift, + blame("gw"), + authorino, + testconfig["service_protection"]["envoy"]["image"], + labels={"app": label}, + ) + request.addfinalizer(gw.delete) + gw.commit() + gw.wait_for_ready(timeout=10 * 60) + return gw + + @pytest.fixture(scope="module") def authorino(authorino, module_label): """Label Authorino controller-metrics service for the proper discovery"""