-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
✅ test: add unit test for src/server/routers/lambda/agent.ts #6192
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
✅ test: add unit test for src/server/routers/lambda/agent.ts #6192
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
👍 @gru-agent[bot] Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6192 +/- ##
==========================================
+ Coverage 91.80% 91.82% +0.01%
==========================================
Files 668 670 +2
Lines 61144 61319 +175
Branches 3054 2874 -180
==========================================
+ Hits 56134 56305 +171
- Misses 5010 5014 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d3f4bf0
to
d52db7d
Compare
✅ Rebase TestGru PR Success
|
🔄 Rebasing Testgru per ... |
52d8725
to
657e4af
Compare
Deployment failed with the following error:
|
Trigger Info
Summary
This PR introduces comprehensive unit tests for the
agentRouter
module, ensuring robust coverage of its functionalities. Key highlights include:Mocking Dependencies: Mocked models (
AgentModel
,FileModel
,KnowledgeBaseModel
,SessionModel
,UserModel
) and services (AgentService
) to isolate and test the router logic.Test Cases:
createAgentFiles
: Verifies the creation of agent files with specified configurations.createAgentKnowledgeBase
: Ensures proper creation of agent knowledge bases.getAgentConfig
: Tests retrieval of agent configurations, including handling of inbox sessions and default configurations.getKnowledgeBasesAndFiles
: Validates the combination of knowledge bases and files returned for an agent.deleteAgentFile
: Confirms deletion of agent files.deleteAgentKnowledgeBase
: Confirms deletion of agent knowledge bases.toggleFile
: Tests toggling the enabled state of files.toggleKnowledgeBase
: Tests toggling the enabled state of knowledge bases.Edge Cases:
Handling scenarios where no user is found for inbox sessions.
Ensuring proper behavior when sessions or knowledge bases are missing.
This addition strengthens the reliability of the
agentRouter
by ensuring its methods behave as expected under various conditions.Tip
You can
@gru-agent
and leave your feedback. TestGru will make adjustments based on your inputTip
You can
@gru-agent rebase
to rebase the PR.Tip
You can
@gru-agent redo
to reset or rebase before redoing the PR.Tip
To modify the test code yourself, click here Edit Test Code