Skip to content

test(go): MCP tool registration + shutdown helper coverage - #87

Merged
couragehong merged 4 commits into
feat/go-migrationfrom
yg/phase-a5-smoke-test
Apr 28, 2026
Merged

couragehong merged 4 commits into
feat/go-migrationfrom
yg/phase-a5-smoke-test

Conversation

@couragehong

@couragehong couragehong commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

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 — TestIsNormalShutdown 6 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:

    • ✅ in-memory smoke (network/stdio 없음, ~1.5s)
    • ✅ tool 카탈로그 회귀 가드 (이름·개수·schema)
    • ✅ stub 응답 포맷 가드
    • ✅ shutdown 정상성 가드
    • ❌ Vault/envector/embedder 연동 테스트 — 어댑터가 아직 없음 (Phase 4 이후)
    • ❌ tools/call panic 가드 직접 테스트 — Register 내부의 defer recover() 는 schema-invalid struct 주입이 필요해 별도 테스트 helper 필요 (follow-up)

Comment thread internal/mcp/register_test.go Outdated
Comment thread internal/mcp/register_test.go
Comment thread internal/mcp/register_test.go Outdated
Base automatically changed from yg/first-mcp-boot to yg/go-runed-migration April 27, 2026 22:54
@couragehong
couragehong changed the base branch from yg/go-runed-migration to feat/go-migration April 27, 2026 23:02
@couragehong
couragehong force-pushed the yg/phase-a5-smoke-test branch from f028e60 to 5cff7f8 Compare April 28, 2026 00:11
couragehong and others added 2 commits April 28, 2026 09:26
… 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>
@couragehong
couragehong merged commit 3dd6d23 into feat/go-migration Apr 28, 2026
1 check passed
@couragehong
couragehong deleted the yg/phase-a5-smoke-test branch April 28, 2026 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants