summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com>2023-08-02 13:56:12 +0300
committerLeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com>2023-08-02 13:56:12 +0300
commit81d640c2ffb351fa7a6e4447a0b4de29108d3e70 (patch)
treee4275e85e9bd6788cffc8be9345e9bf8f66b5c63 /tests
parent47d559eaa384bd0445b5777294e700442b9f7c68 (diff)
Fix tests
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index b569e55..6bb1b1c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -6,7 +6,7 @@ import numpy as np
import pytest
from robusta_krr.api.models import K8sObjectData, PodData, ResourceAllocations
-from robusta_krr.strategies import SimpleStrategy
+from robusta_krr.strategies.simple import SimpleStrategy, SimpleStrategySettings
TEST_OBJECT = K8sObjectData(
cluster="mock-cluster",
@@ -57,11 +57,15 @@ def mock_prometheus_loader():
now_ts, start_ts = now.timestamp(), start.timestamp()
metric_points_data = np.array([(t, random.randrange(0, 100)) for t in np.linspace(start_ts, now_ts, 3600)])
+ settings = SimpleStrategySettings()
+ strategy = SimpleStrategy(settings)
+
with patch(
"robusta_krr.core.integrations.prometheus.loader.PrometheusMetricsLoader.gather_data",
new=AsyncMock(
return_value={
- metric: {pod.name: metric_points_data for pod in TEST_OBJECT.pods} for metric in SimpleStrategy.metrics
+ metric.__name__: {pod.name: metric_points_data for pod in TEST_OBJECT.pods}
+ for metric in strategy.metrics
},
),
) as mock_prometheus_loader: