-
Notifications
You must be signed in to change notification settings - Fork 2
Improve tests #16
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
Improve tests #16
Conversation
These scenarios are now covered by other tests.
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 modernizes the Vancouver module by renaming JsonRpc2 to JsonRpc, streamlining response-generation functions, removing an obsolete testing tool, adding a new CodeReview prompt, and bolstering test coverage for prompts and tools.
- Renamed
JsonRpc2toJsonRpcand updated all references. - Refactored
Vancouver.ToolandVancouver.Promptto consolidate response payloads and add guards. - Introduced
Vancouver.Prompts.CodeReviewand expanded tests forprompts_get,prompts_list, andtools_list. - Removed the deprecated
Vancouver.Tools.TestResponsemodule.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/vancouver/prompt/prompt_test.exs | Added comprehensive tests for send_audio/2, send_image/2, and send_text/2. |
| test/vancouver/plugs/pipeline_test.exs | Updated pipeline tests for MCP methods but missing plug invocation and incorrect aliases. |
| test/vancouver/methods/tools_list_test.exs | Extended ToolsList tests to cover empty and non-empty tool lists. |
| test/vancouver/methods/prompts_list_test.exs | Extended PromptsList tests to cover empty and non-empty prompt lists. |
| test/vancouver/methods/prompts_get_test.exs | Added tests for success, invalid-params, and method-not-found in PromptsGet. |
| test/vancouver/json_rpc_test.exs | Renamed module and alias to match JsonRpc. |
| lib/vancouver/tools/test_response.ex | Removed obsolete TestResponse tool module. |
| lib/vancouver/tool.ex | Consolidated content maps into lists, added guards, and updated alias. |
| lib/vancouver/prompts/code_review.ex | Added new prompt module for code review. |
| lib/vancouver/prompt.ex | Updated alias, enhanced get_role/1 error messages, and replaced JsonRpc2. |
| lib/vancouver/plugs/validate.ex | Updated alias from JsonRpc2 to JsonRpc in validate plug. |
| lib/vancouver/methods/*.ex | Updated aliases in all method modules (unknown, tools_list, tools_call, prompts_list, prompts_get, ping, initialize). |
| lib/vancouver/method.ex | Merged JSON response functions, removed json/2, and added halt(). |
| lib/vancouver/json_rpc.ex | Renamed JsonRpc2 module to JsonRpc. |
Comments suppressed due to low confidence (2)
test/vancouver/plugs/pipeline_test.exs:9
- The alias
Vancouver.PromptTestdoesn’t match the actual module (Vancouver.Prompt.PromptTest). Update the alias or remove it and call the importedVancouver.TestHelpersfunctions directly.
alias Vancouver.PromptTest
test/vancouver/plugs/pipeline_test.exs:11
- The alias
Vancouver.ToolTestpoints to a non-existent module. Either correct it to the real test module or remove it and use the importedVancouver.TestHelpershelpers.
alias Vancouver.ToolTest
This pull request includes a series of changes to improve the
Vancouvermodule by renaming, refactoring, and adding functionality. The most significant updates include renamingJsonRpc2toJsonRpc, refactoring methods to simplify their implementation, introducing a newCodeReviewprompt, and enhancing test coverage for prompts and tools.Renaming and Refactoring
JsonRpc2toJsonRpcacross the codebase, including the module definition, aliases, and associated test files (lib/vancouver/json_rpc.ex,test/vancouver/json_rpc_test.exs). [1] [2] [3] [4]send_jsonfunction inVancouver.Methodby removing the intermediatejson/2method and directly encoding and sending the response (lib/vancouver/method.ex).Prompt and Tool Enhancements
CodeReviewprompt module to analyze code quality and suggest improvements (lib/vancouver/prompts/code_review.ex).TestResponsetool, which provided mock responses for testing purposes (lib/vancouver/tools/test_response.ex).Code Simplification and Validation
Vancouver.Toolto simplify response generation for audio, image, and text responses by consolidating nested maps into single-line maps and adding input validation (lib/vancouver/tool.ex). [1] [2] [3] [4] [5] [6]Vancouver.Promptby refining theget_role/1function to raise more descriptive errors (lib/vancouver/prompt.ex).Test Coverage Improvements
PromptsGetto validate success, error, and "prompt not found" scenarios (test/vancouver/methods/prompts_get_test.exs).PromptsListandToolsListto verify behavior with and without available prompts/tools (test/vancouver/methods/prompts_list_test.exs,test/vancouver/methods/tools_list_test.exs). [1] [2]