Add metrics collection scheduler with automatic job management, improve terminal session cleanup on 404/403 errors, and refactor metrics collection endpoint to use shared background job function with WebSocket broadcast support
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
This commit is contained in:
@@ -105,6 +105,21 @@ class TestSetCollectionSchedule:
|
||||
data = response.json()
|
||||
assert data["interval"] == "30min"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_schedule_triggers_reschedule(self, client: AsyncClient):
|
||||
"""Le changement d'intervalle doit rescheduler le job de collecte."""
|
||||
with patch(
|
||||
"app.routes.metrics.apply_interval_using_global_scheduler",
|
||||
autospec=True,
|
||||
) as mock_apply:
|
||||
response = await client.post(
|
||||
"/api/metrics/collection-schedule",
|
||||
json={"interval": "5min"}
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
mock_apply.assert_called_once_with("5min")
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_schedule_off(self, client: AsyncClient):
|
||||
"""Désactivation de la collecte."""
|
||||
|
||||
Reference in New Issue
Block a user