Repository navigation
test(go): MCP tool registration + shutdown helper coverage - #87
Merged
Merged
Conversation
couragehong
force-pushed
the
yg/first-mcp-boot
branch
from
April 27, 2026 01:27
8574aa5 to
e042ab3
Compare
couragehong
force-pushed
the
yg/phase-a5-smoke-test
branch
from
April 27, 2026 05:13
eaab29f to
f028e60
Compare
esifea
reviewed
Apr 27, 2026
esifea
reviewed
Apr 27, 2026
esifea
reviewed
Apr 27, 2026
couragehong
changed the base branch from
yg/go-runed-migration
to
feat/go-migration
April 27, 2026 23:02
couragehong
force-pushed
the
yg/phase-a5-smoke-test
branch
from
April 28, 2026 00:11
f028e60 to
5cff7f8
Compare
… tools - newSession: keep *ServerSession ref + t.Cleanup so the server side closes on test exit (was discarded with _). - TestRegister_InputSchemaInferred → SchemasInferred: also assert OutputSchema non-nil (tools.go promises both schemas are inferred). - TestRegister_StubReturnsIsError: expand 4 → all 8 tools so a per-tool handler mismatch is caught. Args carry minimal schema-valid values. - docs(v04): progress note updated to match (rename + 8 subtests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
esifea
approved these changes
Apr 28, 2026
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.
Summary
What changed:
internal/mcp/register_test.go— in-memory MCP server/client (sdkmcp.NewInMemoryTransports)띄워서 3 테스트:
TestRegister_All8ToolsListed—tools/list가 정확히 알파벳순 8개 반환TestRegister_InputSchemaInferred— 모든 tool 의 InputSchema non-nil (schema inference 회귀 가드)TestRegister_StubReturnsIsError— 4 tool 샘플 호출 → IsError + "not yet implemented" 메시지 확인cmd/rune-mcp/main_test.go—TestIsNormalShutdown6 subtest (nil / context.Canceled / wrapped / io.EOF / DeadlineExceeded / 임의 에러)Why: 직전 PR (feat(go): Phase A — MCP boot (handshake + tools/list + 8 stub tools) #86, MCP boot) 의 검증은
docs/v04/progress/phase-a-mcp-boot.md§4 의 bash/jq cookbook 으로만 가능 — 수동 실행이라 회귀 발견이 늦음. 이 PR 이 cookbook 의 §4.2 (tools/list) + §4.3 (tools/call stub) 를 Go test 로 정착해go test ./...한 번이 동일 검증을 자동화.Scope:
Register내부의defer recover()는 schema-invalid struct 주입이 필요해 별도 테스트 helper 필요 (follow-up)