From 97c7300dc9a44bb52a8f859d6f0a2faccd038b39 Mon Sep 17 00:00:00 2001 From: phala Date: Mon, 8 Jul 2024 09:04:05 +0200 Subject: [PATCH] Remove kubernetes/metrics package - Move ServiceMonitor to kubernetes - Move metrics client to the root --- testsuite/kubernetes/metrics/__init__.py | 6 ------ testsuite/kubernetes/{metrics => }/service_monitor.py | 0 testsuite/{kubernetes/metrics => }/prometheus.py | 2 +- testsuite/tests/singlecluster/authorino/metrics/conftest.py | 3 ++- 4 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 testsuite/kubernetes/metrics/__init__.py rename testsuite/kubernetes/{metrics => }/service_monitor.py (100%) rename testsuite/{kubernetes/metrics => }/prometheus.py (98%) diff --git a/testsuite/kubernetes/metrics/__init__.py b/testsuite/kubernetes/metrics/__init__.py deleted file mode 100644 index 7cef4ebf..00000000 --- a/testsuite/kubernetes/metrics/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Package implements objects to work with metrics from Prometheus client for Kubernetes""" - -from .prometheus import Prometheus, Metrics -from .service_monitor import ServiceMonitor, MetricsEndpoint - -__all__ = ["Prometheus", "Metrics", "ServiceMonitor", "MetricsEndpoint"] diff --git a/testsuite/kubernetes/metrics/service_monitor.py b/testsuite/kubernetes/service_monitor.py similarity index 100% rename from testsuite/kubernetes/metrics/service_monitor.py rename to testsuite/kubernetes/service_monitor.py diff --git a/testsuite/kubernetes/metrics/prometheus.py b/testsuite/prometheus.py similarity index 98% rename from testsuite/kubernetes/metrics/prometheus.py rename to testsuite/prometheus.py index 9e044dbc..b9ad602e 100644 --- a/testsuite/kubernetes/metrics/prometheus.py +++ b/testsuite/prometheus.py @@ -7,7 +7,7 @@ from apyproxy import ApyProxy from httpx import Client -from .service_monitor import ServiceMonitor +from testsuite.kubernetes.service_monitor import ServiceMonitor def _params(key: str = "", labels: dict[str, str] = None) -> dict[str, str]: diff --git a/testsuite/tests/singlecluster/authorino/metrics/conftest.py b/testsuite/tests/singlecluster/authorino/metrics/conftest.py index d56dacaa..c506166b 100644 --- a/testsuite/tests/singlecluster/authorino/metrics/conftest.py +++ b/testsuite/tests/singlecluster/authorino/metrics/conftest.py @@ -8,7 +8,8 @@ from testsuite.gateway.envoy import Envoy from testsuite.httpx import KuadrantClient from testsuite.kubernetes.config_map import ConfigMap -from testsuite.kubernetes.metrics import ServiceMonitor, MetricsEndpoint, Prometheus +from testsuite.kubernetes.service_monitor import ServiceMonitor, MetricsEndpoint +from testsuite.prometheus import Prometheus @pytest.fixture(scope="module")