-
-
Notifications
You must be signed in to change notification settings - Fork 942
test(backend): add integration tests for services and routes #536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
test(backend): add integration tests for services and routes #536
Conversation
Tests added: - test_connector_service.py: Connector service tests - test_connector_service_extended.py: Extended connector tests - test_connector_indexers_comprehensive.py: Connector indexer tests - test_connector_config.py: Connector configuration tests - test_celery_tasks.py: Celery task tests - test_celery_tasks_comprehensive.py: Comprehensive Celery tests - test_llm_service.py: LLM service tests - test_llm_service_extended.py: Extended LLM service tests - test_routes_documents.py: Document route tests - test_routes_llm_config.py: LLM config route tests - test_routes_search_spaces.py: Search space route tests - test_retrievers.py: Retriever tests - test_agent_configuration.py: Agent configuration tests - test_page_limit_service.py: Page limit service tests These tests mock external services and database interactions.
|
@ankitpasayat is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive integration tests for backend services and routes, improving test coverage across multiple modules including connector services, LLM services, document routes, Celery tasks, and agent configuration.
Key Changes:
- Added 14 new test files with over 200 test cases
- Implemented proper mocking for external services and database interactions
- Tests cover error handling, edge cases, and success scenarios
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test_routes_search_spaces.py | Tests for search space CRUD operations and role management |
| test_routes_llm_config.py | Tests for LLM configuration endpoints and validation |
| test_routes_documents.py | Tests for document management API endpoints |
| test_retrievers.py | Tests for hybrid search retriever initialization |
| test_page_limit_service.py | Tests for page limit tracking and estimation service |
| test_llm_service_extended.py | Extended tests for LLM service configuration and validation |
| test_llm_service.py | Core LLM service tests for role mapping and instance retrieval |
| test_connector_service_extended.py | Extended connector service tests for multiple connector types |
| test_connector_service.py | Core connector service tests for resilience and transformation |
| test_connector_indexers_comprehensive.py | Comprehensive tests for all connector indexers |
| test_connector_config.py | Tests for connector configuration validation |
| test_celery_tasks_comprehensive.py | Comprehensive Celery task tests including schedulers |
| test_celery_tasks.py | Core Celery task tests for connector indexing |
| test_agent_configuration.py | Tests for agent configuration dataclass and enums |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review by RecurseML
🔍 Review performed on 601489b..8375e62
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (14)
• surfsense_backend/tests/test_agent_configuration.py
• surfsense_backend/tests/test_celery_tasks.py
• surfsense_backend/tests/test_celery_tasks_comprehensive.py
• surfsense_backend/tests/test_connector_config.py
• surfsense_backend/tests/test_connector_indexers_comprehensive.py
• surfsense_backend/tests/test_connector_service.py
• surfsense_backend/tests/test_connector_service_extended.py
• surfsense_backend/tests/test_llm_service.py
• surfsense_backend/tests/test_llm_service_extended.py
• surfsense_backend/tests/test_page_limit_service.py
• surfsense_backend/tests/test_retrievers.py
• surfsense_backend/tests/test_routes_documents.py
• surfsense_backend/tests/test_routes_llm_config.py
• surfsense_backend/tests/test_routes_search_spaces.py
Tests added:
These tests mock external services and database interactions.
Description
Motivation and Context
FIX #
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR adds comprehensive integration tests for backend services and routes. The tests cover agent configuration, connector services (Slack, Notion, GitHub, etc.), LLM service functionality, Celery task execution, connector indexers, page limit services, retrievers, and API routes for documents, LLM configs, and search spaces. All tests use mocked database sessions and external dependencies to ensure isolated testing without actual API calls or database connections.
⏱️ Estimated Review Time: 30-90 minutes
💡 Review Order Suggestion
surfsense_backend/tests/test_agent_configuration.pysurfsense_backend/tests/test_retrievers.pysurfsense_backend/tests/test_page_limit_service.pysurfsense_backend/tests/test_connector_config.pysurfsense_backend/tests/test_llm_service.pysurfsense_backend/tests/test_llm_service_extended.pysurfsense_backend/tests/test_connector_service.pysurfsense_backend/tests/test_connector_service_extended.pysurfsense_backend/tests/test_celery_tasks.pysurfsense_backend/tests/test_celery_tasks_comprehensive.pysurfsense_backend/tests/test_connector_indexers_comprehensive.pysurfsense_backend/tests/test_routes_documents.pysurfsense_backend/tests/test_routes_llm_config.pysurfsense_backend/tests/test_routes_search_spaces.py