-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add comprehensive backend test coverage with proper mocking #6
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?
Conversation
Co-authored-by: thegovind <18152044+thegovind@users.noreply.github.com>
Co-authored-by: thegovind <18152044+thegovind@users.noreply.github.com>
Co-authored-by: thegovind <18152044+thegovind@users.noreply.github.com>
@Copilot please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Summary
This PR adds comprehensive test coverage for the backend API, addressing the lack of testing infrastructure identified in the repository. The implementation includes 55 tests covering all major backend components with proper mocking to avoid external dependencies.
What's Added
Configuration Module (4 tests)
Ingestion Pipeline (13 tests)
API Endpoints (8 tests)
Chat API (9 tests)
Agent Tools (8 tests)
Agent Workflows (13 tests)
Technical Approach
Testing Strategy
All tests use the FastAPI TestClient and proper async mocking patterns. External services like Azure Search, Document Intelligence, and OpenAI are mocked to avoid API calls while still validating the integration logic and error handling.
Example test pattern:
Results
Fixes #5.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
openaipublic.blob.core.windows.net
python -m pytest tests/test_ingestion.py -v
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.