-
Notifications
You must be signed in to change notification settings - Fork 550
test: add mock embedding provider tests #1446
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
Conversation
Add comprehensive mock-based unit tests for Cohere and OpenAI embedding providers that run without requiring API credentials. Tests cover: - Provider initialization with known/unknown models - Sync and async encoding methods - Custom parameters (input_type, api_key) - ImportError handling - All predefined model configurations These tests complement existing live integration tests and enable consistent CI/CD testing without external API dependencies.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 mock-based unit tests for external embedding providers (Cohere and OpenAI) to enable testing functionality without requiring API credentials.
- Adds test coverage for both Cohere and OpenAI embedding model providers with complete mocking
- Tests initialization, encoding operations, error handling, and version compatibility
- Validates behavior for both known and unknown models with proper dimension detection
Tip: Customize your code reviews with copilot-instructions.md. Create the file or 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.
Looks good, I have a few questions and nits. Can you point me to the PR with the Cohere embedding provider code?
Added mock-based unit tests for external embedding providers (Cohere and OpenAI) to enable testing without API credentials.
To unblock merging:
#1305
and later:
#1304
#692