summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 327425e..b569e55 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -6,6 +6,7 @@ import numpy as np
import pytest
from robusta_krr.api.models import K8sObjectData, PodData, ResourceAllocations
+from robusta_krr.strategies import SimpleStrategy
TEST_OBJECT = K8sObjectData(
cluster="mock-cluster",
@@ -57,9 +58,11 @@ def mock_prometheus_loader():
metric_points_data = np.array([(t, random.randrange(0, 100)) for t in np.linspace(start_ts, now_ts, 3600)])
with patch(
- "robusta_krr.core.integrations.prometheus.loader.MetricsLoader.gather_data",
+ "robusta_krr.core.integrations.prometheus.loader.PrometheusMetricsLoader.gather_data",
new=AsyncMock(
- return_value={pod.name: metric_points_data for pod in TEST_OBJECT.pods},
+ return_value={
+ metric: {pod.name: metric_points_data for pod in TEST_OBJECT.pods} for metric in SimpleStrategy.metrics
+ },
),
) as mock_prometheus_loader:
mock_prometheus_loader
@@ -68,5 +71,5 @@ def mock_prometheus_loader():
@pytest.fixture(autouse=True, scope="session")
def mock_prometheus_init():
- with patch("robusta_krr.core.integrations.prometheus.loader.MetricsLoader.__init__", return_value=None):
+ with patch("robusta_krr.core.integrations.prometheus.loader.PrometheusMetricsLoader.__init__", return_value=None):
yield