From 2249b15e34e414c270c62a970d95df65b0704cc2 Mon Sep 17 00:00:00 2001 From: Christian Krakau-Louis Date: Sun, 8 Feb 2026 09:08:27 +0100 Subject: [PATCH] Create GitHub issue for fixing failing tests in CI workflow. --- issues/2026-02-08-fix-failing-tests.md | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 issues/2026-02-08-fix-failing-tests.md diff --git a/issues/2026-02-08-fix-failing-tests.md b/issues/2026-02-08-fix-failing-tests.md new file mode 100644 index 00000000..923a7dcf --- /dev/null +++ b/issues/2026-02-08-fix-failing-tests.md @@ -0,0 +1,41 @@ +# Fix failing tests in CI workflow + +## Problems Addressed: + +1. **Services Not Running (Redis, RabbitMQ)** - Many test failures are caused by connection errors to Redis (localhost:6379) and AMQP/RabbitMQ (127.0.0.1:5672) with ConnectionRefusedError: [Errno 111] Connection refused. Need to add service containers to .github/workflows/tests.yaml: + ```yaml + services: + redis: + image: redis:7 + ports: + - 6379:6379 + rabbitmq: + image: rabbitmq:3-management + ports: + - 5672:5672 + - 15672:15672 + ``` + +2. **Jinja2 Template Error: 'file' is undefined** - Error in file_detail.html template. The view rendering this template is missing the 'file' variable in the context when handling nonexistent files. Need to ensure the template response includes the file variable or handle the error case differently. + +3. **SQLAlchemy IntegrityError: NOT NULL constraint failed: files.local_filename** - In tests/test_bulk_operations.py::TestBulkOperations::test_bulk_reprocess_missing_files, the test tries to insert a file record with local_filename=None, but the database schema requires this field. Need to fix test data or make the field nullable. + +4. **API Response Type Mismatch** - In tests/test_api.py::TestFileEndpoints::test_list_files_empty, the test expects a list but receives a dictionary with 'files' and 'pagination' keys. Need to update either the test expectations or the API response format to be consistent. + +5. **Subtask Retry Error Message** - In tests/test_file_detail_endpoints.py::TestSubtaskRetry::test_retry_subtask_invalid_task_name, the test expects error message 'invalid subtask name' but gets 'processed file not found. cannot retry upload.'. Need to fix the error handling logic. + +6. **File Reprocessing 500 Error** - In tests/test_file_detail_endpoints.py::TestFileReprocessing::test_reprocess_existing_file, the endpoint returns 500 Internal Server Error instead of 200. Need to investigate the cause of this server error. + +## Failed Tests: +- tests/test_api.py::TestFileEndpoints::test_list_files_empty +- tests/test_bulk_operations.py::TestBulkOperations::test_bulk_reprocess_missing_files +- tests/test_file_detail_endpoints.py::TestFileReprocessing::test_reprocess_existing_file +- tests/test_file_detail_endpoints.py::TestSubtaskRetry::test_retry_subtask_invalid_task_name +- tests/test_file_detail_endpoints.py::TestFileDetailView::test_file_detail_view_nonexistent +- All tests in test_file_upload.py (9 tests failing due to RabbitMQ connection) + +## CI Run: +[https://github.com/christianlouis/DocuElevate/actions/runs/21794817705/job/62880458485](https://github.com/christianlouis/DocuElevate/actions/runs/21794817705/job/62880458485) + +## Commit: +`93149d0c56e0e7373ad92d59fd8c575eb9095914` \ No newline at end of file