Add integration tests for new MCP efficiency tool step attribute - #109
Open
nikita-phantom-ops wants to merge 1 commit into
Open
Add integration tests for new MCP efficiency tool step attribute#109nikita-phantom-ops wants to merge 1 commit into
nikita-phantom-ops wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Go integration-test file, test/integration/mcp/efficiency_step_test.go, covering the newly added step attribute on the MCP get_efficiency tool (follow-up to opencost/opencost#3869). It introduces a helper to call the tool over MCP/JSON-RPC and three test suites: step/no-step consistency, large-window OOM resilience, and rejection of invalid step values. It reuses the shared helpers (initializeMCPSession, getMCPURL, MCPResponse, abs) already present in helpers.go.
Changes:
- Adds
MCPEfficiencyRequest/MCPEfficiencyDatatypes andcallMCPEfficiencyToolto invoke theget_efficiencyMCP tool. - Adds
TestMCPEfficiencyStepConsistency,TestMCPEfficiencyStepDoesNotOOM, andTestMCPEfficiencyInvalidStep, plus acompareEfficiencyResultshelper with cost/efficiency tolerance checks. - Note: the new file is not registered in
test/integration/mcp/test.bats, so the CI harness (bats -r test/integration) will not execute these tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
nikita-phantom-ops
force-pushed
the
add-mcp-efficiency-step-tests
branch
from
June 22, 2026 14:21
3ade8c4 to
4e4fa55
Compare
nikita-phantom-ops
force-pushed
the
add-mcp-efficiency-step-tests
branch
from
June 22, 2026 14:32
4e4fa55 to
01f3bdb
Compare
Signed-off-by: Nikita <[email protected]>
nikita-phantom-ops
force-pushed
the
add-mcp-efficiency-step-tests
branch
from
June 22, 2026 14:47
01f3bdb to
40a8d42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adding tests to address the new MCP efficiency_tool functionality with the step attribute added.
Tests include:
This PR is a follow up of opencost/opencost#3869