Add integration tests#136
Conversation
|
@copilot review the PR |
There was a problem hiding this comment.
Code Review
This pull request significantly expands the test suite for the MCP server, introducing integration tests for the V2 API and comprehensive unit tests for session messaging, dashboard creation, and data source discovery. It also adds health check tests for the API server and connection validation tests for the ThoughtSpot service. Feedback was provided regarding the redundant instantiation of the MCPServer across multiple test blocks, suggesting the use of a shared instance to improve consistency and reduce boilerplate.
| const testServer = new MCPServer( | ||
| { props: mockProps }, | ||
| new StreamingMessagesStorageWithTtl(null as any, vi.fn(), vi.fn()), | ||
| ); |
There was a problem hiding this comment.
There is redundant instantiation of the MCPServer within multiple it blocks (e.g., lines 1281, 1302, 1328, 1378, etc.). A fresh instance is already created and assigned to the server variable in the top-level beforeEach block (line 34). Using the existing server instance instead of creating a local testServer would reduce boilerplate and improve consistency. Additionally, the inconsistent use of server vs testServer across different tests makes the suite harder to maintain.
All 33 test files pass (643 tests, 5 skipped). Here's the full review: ✅ What's well done
None of these are blocking; the suite is solid and the coverage improvement is meaningful. |
Replace redundant local testServer instantiations inside it blocks with the top-level server variable already created in beforeEach, reducing boilerplate and ensuring consistent test setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@copilot review the PR |
All 643 tests pass, all 4 CI runs are green, and the three observations raised in the previous review have all been addressed in commits
The PR is ready to merge. |
No description provided.