[AI] Expand Test Coverage - mcp#2359
Conversation
Added extensive test coverage for the `tavern/internal/mcp` module. Created an `export_test.go` file within the `mcp` package to expose unexported handlers to the `mcp_test` package without polluting the production code. Implemented comprehensive unit tests for `HandleListHosts`, `HandleListQuests`, `HandleListTomes`, `HandleQuestOutput`, `HandleWaitForQuest`, and `HandleCreateQuest`, verifying correct output JSON and handling of error paths such as missing context clients or invalid parameter formats. The module coverage has been increased from ~16.2% to ~78.3%, and all tests have been repeatedly verified to prevent flakiness. Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR focuses on increasing the test coverage of the
tavern/internal/mcpmodule, which previously had low coverage (around 16%). The update introduces anexport_test.gofile within the package to expose internal functions such as tool handlers (handleListHosts,handleCreateQuest, etc.) and internal context keys. Extensive test cases were then added tomcp_test.goto test each handler.Key achievements:
tavern/internal/mcpstatement coverage from 16.2% to 78.3%.export_test.goexposed functions without muddying the public API.PR created automatically by Jules for task 2613559184124500128 started by @KCarretto