test(http): split http_router_test.exs by concern#1082
Conversation
Splits the 902-line/39-test mcp_server/test/ptc_runner_mcp/http_router_test.exs into five concern-scoped files under http/ (auth, host, origin, dispatch, telemetry), all preserved verbatim. The shared ~20-line setup and conn helpers move into a new ExUnit.CaseTemplate (PtcRunnerMcp.Http.RouterCase) that each file uses, so there is no duplicated setup. Every file stays async: false. Verified: cd mcp_server && mix test runs 39 router tests, 0 failures; mix precommit green. Closes #1076 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PR Review: test(http): split http_router_test.exs by concernSummarySplits the 902-line / 39-test What's Good
Verification performed
Issues (Must Fix)None. Suggestions (Optional)None — the split is tidy and the helper placement is sensible. SecurityNo concerns. Test-only change; no production code touched. DocumentationNo updates needed. This is a test reorganization with no public API or behavior change. The VerdictApprove. Mechanical, spec-conformant split with proper deduplication via |
Auto-Triage Summary
Review verdict: Approve — mechanical, spec-conformant split with no must-fix or optional items raised. Labelled . |
Splits the 902-line/39-test mcp_server/test/ptc_runner_mcp/http_router_test.exs into five concern-scoped files under http/ (auth, host, origin, dispatch, telemetry), all preserved verbatim. The shared ~20-line setup and conn helpers move into a new ExUnit.CaseTemplate (PtcRunnerMcp.Http.RouterCase) that each file uses, so there is no duplicated setup. Every file stays async: false. Verified: cd mcp_server && mix test runs 39 router tests, 0 failures; mix precommit green. Closes #1076
Summary
Splits the 902-line / 39-test
mcp_server/test/ptc_runner_mcp/http_router_test.exsinto five concern-scoped files underhttp/, with no test-logic changes (mechanical move):http/router_auth_test.exsPtcRunnerMcp.Http.RouterAuthTesthttp/router_host_test.exsPtcRunnerMcp.Http.RouterHostTesthttp/router_origin_test.exsPtcRunnerMcp.Http.RouterOriginTesthttp/router_dispatch_test.exsPtcRunnerMcp.Http.RouterDispatchTesthttp/router_telemetry_test.exsPtcRunnerMcp.Http.RouterTelemetryTestThe shared ~20-line
setupblock plus the common conn helpers (auth/1,call/1,with_host/2,initialize_session/1) move into a newExUnit.CaseTemplate—PtcRunnerMcp.Http.RouterCaseintest/support/http_router_case.ex— that each split fileuses. Concern-specific helpers (bad_auth_post/1,attach_http_telemetry/0,start_ptc_sessions!/0, etc.) stay in their respective files. Every file remainsasync: false(global env + named registry). The original file is deleted.Test plan
cd mcp_server && mix test test/ptc_runner_mcp/http/router_*_test.exs→ 39 tests, 0 failures (same count as before)mix precommitgreen (format, compile-as-errors, credo, dialyzer, full suite: 794 tests 0 failures)Closes #1076
🤖 Generated with Claude Code