Skip to content

[Repo Assist] test: add coverage for SshTunnelCommandLine, ExecApprovalV2Result, and McpToolBridge gaps#245

Merged
shanselman merged 1 commit intomasterfrom
repo-assist/test-coverage-gaps-2026-04-30-65a654dd5692eb5d
May 1, 2026
Merged

[Repo Assist] test: add coverage for SshTunnelCommandLine, ExecApprovalV2Result, and McpToolBridge gaps#245
shanselman merged 1 commit intomasterfrom
repo-assist/test-coverage-gaps-2026-04-30-65a654dd5692eb5d

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated PR from Repo Assist.

Fills three small but meaningful coverage gaps in the Shared test suite:

1. SshTunnelCommandLine — 8 new tests

CanForwardBrowserProxyPort had zero test coverage despite being a public API with a clear contract (ports must be in range 1–65533). Added a [Theory] with 6 boundary cases:

remotePort localPort expected
1 1 true
18789 28789 true
65533 65533 true
65534 28789 false
28789 65534 false
0 28789 false

Whitespace trimming in BuildArguments was untested. The implementation trims user and host before regex validation, but no test verified that " scott " and " mac-mini.local " produce the expected output rather than throwing ArgumentException.

2. ExecApprovalV2Result.ToString() — 1 new test

The ToString() override formats as "{Code}: {Reason}" but was completely untested. The test verifies both Code and Reason appear in the output.

3. McpToolBridge — 2 new tests

  • Custom serverName/serverVersion: The constructor accepts these parameters but all existing tests used the defaults. A test with explicit values confirms initialize reflects them in result.serverInfo.
  • Null arguments: "arguments": null is a valid JSON-RPC value (distinct from omitting the field). The bridge's args.ValueKind == JsonValueKind.Null branch was exercised but not tested.

Test Status

Suite Result
OpenClaw.Shared.Tests ✅ all pass
OpenClaw.Tray.Tests ✅ all pass

Generated by 🌈 Repo Assist, see workflow run. Learn more.

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@97143ac59cb3a13ef2a77581f929f06719c7402a

…ge coverage gaps

- SshTunnelCommandLine: 7 new tests covering CanForwardBrowserProxyPort
  boundary values and BuildArguments whitespace trimming
- ExecApprovalV2Result: test ToString() includes code and reason
- McpToolBridge: test custom serverName/serverVersion via constructor;
  test that null arguments value is accepted (not just missing arguments)

All tests pass (Shared + Tray).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@shanselman shanselman marked this pull request as ready for review May 1, 2026 16:54
@shanselman shanselman merged commit 61ef7d1 into master May 1, 2026
3 checks passed
@shanselman shanselman deleted the repo-assist/test-coverage-gaps-2026-04-30-65a654dd5692eb5d branch May 1, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant