Repository navigation
[test] Add tests for launcher.getOrLaunchWithConfig - #15636
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔒 mcpg Read-Only Stress — defaultSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE No write leaked through mcpg. Part A/C reads succeeded via both the GitHub MCP tools and the proxied No reaction, star, issue, comment, branch, file, or PR was created.
|
There was a problem hiding this comment.
🟢 Approval recommended
The focused test-only change has no blocking issues; the remaining failure-attribution issue is non-blocking.
No open issues 🎉
What changed in this PR
Adds regression tests for the launcher's closed-state behavior without changing production code.
Changes:
- Exercises
getOrLaunchWithConfigand public launch entry points with HTTP and stdio configurations. - Verifies
ErrLauncherClosed, nil returned connections, and an empty connection cache.
| File | Description |
|---|---|
internal/launcher/closed_launcher_test.go |
Adds table-driven tests for calls made after launcher shutdown. |
Review effort: Max
Test Coverage Improvement: getOrLaunchWithConfig
Function Analyzed
internal/launchergetOrLaunchWithConfig(plus closed-launcher guards inGetOrLaunch/GetOrLaunchForSession)Why This Function?
Most functions were already well covered; this was among the most complex with uncovered branches: the early
ErrLauncherClosedreturn on a closed launcher.Tests Added
TestGetOrLaunchWithConfig_ClosedLaunchercovering HTTP and stdio backends viagetOrLaunchWithConfig,GetOrLaunch, andGetOrLaunchForSessionErrLauncherClosedis returned, no connection is returned, and no connections are cachedTest Execution
go test ./internal/launcher/passes;go vetandgofmtclean.Remaining uncovered lines are races (launcher closed mid-launch) and the OIDC-missing-provider path.
Generated by Test Coverage Improver
Warning
Firewall blocked 4 domains
The following domains were blocked by the firewall during workflow execution:
example.comnonexistent.localslow.example.comthishostdoesnotexist12345.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.