test: add unit tests for DeepSeek, GLM, Kimi, and Qwen providers#189
Merged
asdek merged 1 commit intovxcontrol:feature/next_releasefrom Mar 11, 2026
Merged
Conversation
Add config loading, provider type, models loading, model prefix, missing API key, and usage tests for the four Chinese LLM providers that were expanded in PR vxcontrol#185 but had no test coverage. GLM tests use non-negative price assertions to accommodate free-tier models (glm-4.7-flash, glm-4.5-flash). Signed-off-by: mason5052 <ehehwnwjs5052@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds missing unit test coverage for the four China-based LLM providers introduced in #185 (DeepSeek, GLM/Zhipu, Kimi/Moonshot, Qwen/DashScope), aligning them with the existing provider test patterns used across the codebase.
Changes:
- Introduce provider test suites validating config loading, model selection, and pricing for all agent types.
- Add tests for provider type constants, embedded
models.ymlparsing, and LiteLLM-style model prefix handling. - Add negative-path and utility tests for missing API keys and token usage extraction.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backend/pkg/providers/deepseek/deepseek_test.go | Adds unit tests for DeepSeek provider config/model/price loading, prefix behavior, API key validation, and usage parsing. |
| backend/pkg/providers/glm/glm_test.go | Adds unit tests for GLM provider with non-negative price assertions to support free-tier models, plus prefix/API key/usage coverage. |
| backend/pkg/providers/kimi/kimi_test.go | Adds unit tests for Kimi provider config/model/price loading, prefix behavior, API key validation, and usage parsing. |
| backend/pkg/providers/qwen/qwen_test.go | Adds unit tests for Qwen provider config/model/price loading, prefix behavior, API key validation, and usage parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
thank you for the PR! |
36 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Change
Problem
The four Chinese LLM providers (DeepSeek, GLM/Zhipu AI, Kimi/Moonshot AI, Qwen/Tongyi Qianwen) expanded in PR #185 had zero test coverage. Other providers like Anthropic, Bedrock, Gemini, and OpenAI all have comprehensive test suites.
Solution
Add unit tests for all four providers following the established test patterns (consistent with
anthropic_test.go,openai_test.go, etc.):prefix/model-name)GLM tests use
< 0(non-negative) price assertions instead of<= 0(positive) to accommodate free-tier models (glm-4.7-flash,glm-4.5-flash) with zero pricing.Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Results
All 28 tests pass (7 per provider x 4 providers):
Checklist
go fmtandgo vet