From 9a3e54e6ece9e824616a8d631826bf14c5d05445 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Mon, 3 Aug 2026 14:58:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B(backend)=20disable=20recording=20e?= =?UTF-8?q?vents=20in=20the=20default=20env=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The tests were failing when the Django settings did not disable recording events, which was the case by default. We do not rely on these events anymore by default, so set the corresponding environment variable to false in the env file to make the tests pass out of the box. --- env.d/development/common.dist | 2 +- src/backend/core/tests/services/test_livekit_events.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/env.d/development/common.dist b/env.d/development/common.dist index c48d903e..99e1499e 100644 --- a/env.d/development/common.dist +++ b/env.d/development/common.dist @@ -63,7 +63,7 @@ ALLOW_UNREGISTERED_ROOMS=False # Recording RECORDING_ENABLE=True -RECORDING_STORAGE_EVENT_ENABLE=True +RECORDING_STORAGE_EVENT_ENABLE=False RECORDING_STORAGE_EVENT_TOKEN=password SUMMARY_SERVICE_ENDPOINT=http://app-summary-dev:8000/api/v2/async-jobs/transcribe/ SUMMARY_SERVICE_API_TOKEN=password diff --git a/src/backend/core/tests/services/test_livekit_events.py b/src/backend/core/tests/services/test_livekit_events.py index 16adb661..694f04e9 100644 --- a/src/backend/core/tests/services/test_livekit_events.py +++ b/src/backend/core/tests/services/test_livekit_events.py @@ -72,11 +72,12 @@ def test_initialization( ) @mock.patch("core.utils.notify_participants") @mock.patch("core.services.room_management.RoomManagement.update_metadata") -def test_handle_egress_ended_success( - mock_update_metadata, mock_notify, mode, notification_type, service +def test_handle_egress_ended_success( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-positional-arguments + mock_update_metadata, mock_notify, mode, notification_type, service, settings ): """Should successfully stop recording and notifies all participant.""" + settings.RECORDING_STORAGE_EVENT_ENABLE = False recording = RecordingFactory(worker_id="worker-1", mode=mode, status="active") mock_data = mock.MagicMock() mock_data.egress_info.egress_id = recording.worker_id @@ -155,11 +156,12 @@ def test_handle_egress_updated_non_handled( ) @mock.patch("core.utils.notify_participants") @mock.patch("core.services.room_management.RoomManagement.update_metadata") -def test_handle_egress_ended_metadata_update_fails( - mock_update_metadata, mock_notify, mode, notification_type, service +def test_handle_egress_ended_metadata_update_fails( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-positional-arguments + mock_update_metadata, mock_notify, mode, notification_type, service, settings ): """Should successfully stop and save recording when metadata's update fails.""" + settings.RECORDING_STORAGE_EVENT_ENABLE = False recording = RecordingFactory(worker_id="worker-1", mode=mode, status="active") mock_data = mock.MagicMock() mock_data.egress_info.egress_id = recording.worker_id