Skip to main content
Glama
Rajendertyagi

MCPEvent

MCP Event Server — テストスイート

MCPイベントサーバー(server.py、events.py、store.py、runtime.py、sources/)向けの、機能重視で高速かつハングセーフな回帰テストです。

レイアウト

test/
  run_all.py            # regression driver: isolated subprocess per file, hard 300s/file timeout
  helpers/              # lifecycle, mcp, wait, mock_http, runner — shared test support
  mcp_result.py         # SDK result normalization + safe teardown
  test_*.py             # one feature per file (the units of the suite)
  config.json           # base server config (overwritten per-test, restored after)
TEST_RUNTIME_MAP.md     # per-file server usage, harness behavior, run guidance

test/ 配下のプロダクションソースは凍結されています — テスト作業の一環として server.py、events.py、store.py、runtime.py、errors.py、client.py、config.json、requirements.txt、または sources/* を編集しないでください。

Related MCP server: MCP Server & Client Test Environment

実行

# Focused (preferred while debugging one feature):
python test/test_acknowledgement.py
python test/run_all.py --group fast

# Full regression (CI / release only — slow path):
python test/run_all.py
python test/run_all.py --timeout 300

サーバー使用法マトリクス、制限付き待機戦略、および開発中にフルテストではなくフォーカステストを実行すべき理由については、TEST_RUNTIME_MAP.md を参照してください。

原則

  • テストがMCP/HTTP境界を必要としない限り、サーバーは不要。 アプリケーションロジック(ストア、イベント、ルーティング、チェックポイント/ACK、バックグラウンドタスク、ソースライフサイクル、重複排除)は、インメモリスタブバスを使用して実際のオブジェクトに対して直接テストされます。

  • Dレベルのファイルごとに1つのサーバー(例外:test_errors.py / test_reconnect.py の再起動テスト、および異なるソース設定を必要とするテストがある test_subscriptions.py)。

  • 制限付き待機、長時間の固定スリープなし。 準備完了/カウントはタイムアウト付きでポーリングされます。

  • ハードタイムアウト(300秒/ファイル)+ 親プロセスによるクリーンアップ — ランナーは子プロセスのプロセスグループを終了するため、ハングしたファイルは迅速に失敗し(TIMEOUT として報告されます)、そのファイルが起動した server.py も強制終了されます。子プロセスの atexit に依存しません(ハードキル後は実行できません)。

削除済み(再作成しないでください)

test/test_phase8.py、test/integrate_test.py — 上記の機能別ファイルに置き換えられました。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A test server implementing all features of the MCP protocol, including prompts, tools, resources, and sampling, designed for testing MCP clients rather than practical applications.
    MIT