diff options
| author | LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> | 2023-08-02 10:51:24 +0300 |
|---|---|---|
| committer | LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> | 2023-08-02 10:51:24 +0300 |
| commit | 5d37d7e2b943d6a3dd6f04b867eb3291d37e64f1 (patch) | |
| tree | db73b721952ad2020ba40525563adec2807d8029 /tests | |
| parent | 288c8de2a52a879d9fe654538e2c167c554ec950 (diff) | |
Fix tests
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/conftest.py | 9 |
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 |
