Converted CLI tests to use vitest#1012
Conversation
… version, fixed problem with undetected failures (isError: true payloads).
…stry), all tests actually validate what they say they test.
|
@claude can you please review this PR? |
|
Claude finished @cliffhall's task in 1m 58s —— View job PR Review: Convert CLI Tests to VitestGreat work on this comprehensive test migration! This PR significantly improves the CLI test infrastructure. Below is my detailed review. ✅ Strengths1. Solid Test Infrastructure
2. Improved Test Quality
3. Code Quality
4. Configuration
|
… up process termination (possible leak on Windows), beefed up http server cleanup (close all connections), removed unused hasValidJsonOutput, reduced CLI timeout to give it breathing room with vitest timeout.
|
I addressed the valid points from the Claude PR review. This should be ready to merge. |
…pes, terminology, and usage.
olaservo
left a comment
There was a problem hiding this comment.
Thank you for this huge improvement! Ran and reviewed locally - there's a few minor things I think we can tweak but will just put those into a fast-follow PR rather than blocking this one.
Thanks for getting this one in @olaservo. I had it on my list to get done today. |
Summary
CLI tests were implemented in scripts (not any kind of test framework), which caused a number of issues, including tests that "failed" but didn't cause the script to return failure.
Also, none of the tests actually validated the thing being tested - they only validated whether the CLI run produced an error or a "success" (which included MCP protocol responses with isError: true).
Type of Change
Changes Made
Implemented all existing CLI tests in vitest, removed old script-based CLI tests. Updated all tests to ensure they actually validate the thing the test is supposed to test. Remove all references to server-everything and any other registry provided servers. All tests now use an MCP server test harness implemented within the test infra - a stdio server that collects cwd, env vars, and params and reports them as resources for validation, or an sse/http composable and instrumented test server that can provide headers, message replay, detailed metadata, etc).
Testing
Test Results and/or Instructions
Run all tests via
npn run test- all 85 tests should pass.Checklist
npm run prettier-fix)Breaking Changes
No
Additional Context
Updated
npm testtarget, so CI should work properly (but not tested)