From 5d37d7e2b943d6a3dd6f04b867eb3291d37e64f1 Mon Sep 17 00:00:00 2001 From: LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> Date: Wed, 2 Aug 2023 10:51:24 +0300 Subject: Fix tests --- tests/conftest.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3