diff options
| author | LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> | 2023-08-02 14:01:47 +0300 |
|---|---|---|
| committer | LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> | 2023-08-02 14:01:47 +0300 |
| commit | 5debaa6dccd731c4df49c63062d1e371be51f1ad (patch) | |
| tree | bd007e415649c3cecde6b77b1e60c712e84483e3 /tests | |
| parent | c5b610c47e6a5694c9b58847ca043815bd0fc1b4 (diff) | |
| parent | d202105fdb60b20b37c34289566967a214c0e0ca (diff) | |
Merge branch 'main' into refactoring-and-optimization
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/conftest.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index b6ac6f5..7b570a7 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", @@ -66,11 +66,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: |
