Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add MCP Integration Tests for Allocation and Asset APIs
Summary
Adds comprehensive integration tests to validate that the MCP (Model Context Protocol) tools return identical results to the HTTP API endpoints for both allocation and asset queries.
Changes
New Files
test/integration/mcp/allocation_mcp_vs_http_test.go– Tests comparing MCPget_allocation_coststool with/allocationHTTP endpointtest/integration/mcp/asset_mcp_vs_http_test.go– Tests comparing MCPget_asset_coststool with/assetsHTTP endpointtest/integration/mcp/helpers.go– Shared helper functions and types for MCP session managementtest/integration/mcp/test.bats– Bats test runner following repo conventionsTest Coverage
Allocation Tests (
TestMCPAllocationVsHTTP)Tests various allocation queries with historical time windows to ensure reproducible results:
Validates:
0.01with 0.1% difference threshold)Asset Tests (
TestMCPAssetVsHTTP)Tests asset queries with historical time windows:
Validates:
Key Features
helpers.goTest Results
✅ All allocation tests passing (6/6)
✅ All asset tests passing (3/3)
Testing
Run all tests via Bats (recommended)