diff --git a/app/services/test_runner_service.py b/app/services/test_runner_service.py index 280f0d76..8bfc1e5e 100644 --- a/app/services/test_runner_service.py +++ b/app/services/test_runner_service.py @@ -96,14 +96,15 @@ class TestRunnerService: report = json.load(f) self._process_json_report(db, test_run, report) - except FileNotFoundError: - # Fallback to parsing stdout + except (FileNotFoundError, json.JSONDecodeError) as e: + # Fallback to parsing stdout if JSON report failed + logger.warning(f"JSON report unavailable ({e}), parsing stdout") self._parse_pytest_output(test_run, result.stdout, result.stderr) finally: # Clean up temp file try: Path(json_report_path).unlink() - except: + except Exception: pass # Set final status diff --git a/requirements-test.txt b/requirements-test.txt index 628612da..324900f8 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -4,6 +4,7 @@ pytest>=8.3.4 pytest-cov>=6.0.0 pytest-asyncio>=0.24.0 pytest-mock>=3.14.0 +pytest-json-report>=1.5.0 httpx>=0.28.1 faker>=33.1.0 pytest-repeat>=0.9.4