From 5d0d249f1dc82f422f2bbcd31f238cfb9779694c Mon Sep 17 00:00:00 2001 From: maziggy Date: Tue, 10 Feb 2026 17:49:58 +0100 Subject: [PATCH 1/2] Fix CI backend-tests failing to collect FTP test suite CI only installed requirements.txt, missing pyOpenSSL from requirements-dev.txt. This caused an ImportError on TLS_FTPHandler during test collection, blocking all unit/services tests. Also adds pytest-timeout to dev deps instead of ad-hoc pip install in CI. --- .github/workflows/ci.yml | 2 +- requirements-dev.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c73de5220..243ebd39b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install pytest pytest-asyncio pytest-cov pytest-timeout + pip install -r requirements-dev.txt - name: Run tests timeout-minutes: 10 diff --git a/requirements-dev.txt b/requirements-dev.txt index a08c02f62..522e76236 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,6 +3,7 @@ pytest>=8.0.0 pytest-asyncio>=0.23.0 pytest-cov>=4.1.0 pytest-xdist>=3.5.0 +pytest-timeout>=2.4.0 httpx>=0.27.0 ruff>=0.8.0 From 40f4e60f0492e59c66f73f50fc9f1f317e2929ab Mon Sep 17 00:00:00 2001 From: Jeff Kletsky Date: Tue, 10 Feb 2026 18:54:50 -0800 Subject: [PATCH 2/2] Remove print() debugging from external_camera.py There were several instances where print() debugging was used instead of or in addition to formal logging. These messages were tagged `[EXT-CAM]`. Where there was already a logging call, the print statement was removed. Where there was not, logger.debug() was used as a replacement. Signed-off-by: Jeff Kletsky --- backend/app/services/external_camera.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/app/services/external_camera.py b/backend/app/services/external_camera.py index 1ffa43782..3844c93d5 100644 --- a/backend/app/services/external_camera.py +++ b/backend/app/services/external_camera.py @@ -362,7 +362,7 @@ async def _capture_rtsp_frame(url: str, timeout: int) -> bytes | None: ] try: - print(f"[EXT-CAM] Running ffmpeg command: {' '.join(cmd[:6])}...") + logger.debug(f"Running ffmpeg command: {' '.join(cmd[:6])}...") process = await asyncio.create_subprocess_exec( *cmd, stdout=asyncio.subprocess.PIPE, @@ -370,13 +370,12 @@ async def _capture_rtsp_frame(url: str, timeout: int) -> bytes | None: ) stdout, stderr = await asyncio.wait_for(process.communicate(), timeout=timeout) - print( - f"[EXT-CAM] ffmpeg returned: code={process.returncode}, stdout={len(stdout)} bytes, stderr={len(stderr)} bytes" + logger.debug( + f"ffmpeg returned: code={process.returncode}, stdout={len(stdout)} bytes, stderr={len(stderr)} bytes" ) if process.returncode != 0: logger.error("ffmpeg RTSP capture failed: %s", stderr.decode()[:200]) - print(f"[EXT-CAM] ffmpeg error: {stderr.decode()[:300]}") return None if not stdout or len(stdout) < 100: @@ -440,11 +439,9 @@ async def test_connection(url: str, camera_type: str) -> dict: Returns: Dict with {success: bool, error?: str, resolution?: str} """ - print(f"[EXT-CAM] Testing camera connection: type={camera_type}, url={url[:50]}...") logger.info("Testing camera connection: type=%s, url=%s...", camera_type, url[:50]) try: frame = await capture_frame(url, camera_type, timeout=10) - print(f"[EXT-CAM] Capture result: {len(frame) if frame else 0} bytes") logger.info("Capture result: %s bytes", len(frame) if frame else 0) if frame: