Skip to content

[test-improver] Improve tests for cmd - #16111

Merged
lpcox merged 1 commit into
mainfrom
test-improver/cmd-testify-1794020057-d00006dbc141deb1
Nov 7, 2026
Merged

lpcox merged 1 commit into
mainfrom
test-improver/cmd-testify-1794020057-d00006dbc141deb1

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Files: internal/cmd/completion_test.go, internal/cmd/run_proxy_test.go

Improvements: Replaced manual t.Fatal and t.Errorf calls with testify. require.Fail replaces the four shutdown-timeout t.Fatal calls. assert.ErrorIs(..., os.ErrClosed) replaces the pipe-close t.Errorf calls, and the now-unused errors import is removed.

Coverage: The cmd package stays at 93.5%. The changes are stylistic only, with no behavior change.

Verification: go vet and gofmt -l are clean. go test -count=3 ./internal/cmd/ passes (ok, 24.6s).

Generated by Test Improver · copilot · auto · ~23 AIC · ⊞ 9.5K · ◷

@lpcox
lpcox marked this pull request as ready for review November 7, 2026 06:19
Copilot AI adaptive review requested due to automatic review settings November 7, 2026 06:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The test-only assertion updates address the reviewed shutdown and pipe-error checks while removing the unused import, leaving no active issues.

No open issues 🎉

What changed in this PR

This pull request standardizes assertion usage in internal/cmd tests without changing production behavior or test coverage.

Changes:

  • Replaces shutdown-timeout t.Fatal calls with require.Fail.
  • Replaces manual pipe-close checks with assert.ErrorIs.
  • Removes the unused errors import.

This pull request is ready to be approved.

File Description
internal/​cmd/​run_proxy_test.go Uses require.Fail for four shutdown-timeout test failures.
internal/​cmd/​completion_test.go Uses assert.ErrorIs for expected closed-pipe errors and removes the unused import.

Review effort: Lite (auto)

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

🔒 mcpg Read-Only Stress — default

Surface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Isolation runtime: default AWF (normal container isolation)

Part Surface Op Result Expected Status
A MCP reads (list_issues, list_pull_requests, get_file_contents, list_commits) data returned (200) ALLOWED ✅
B MCP writes (add_issue_comment/star_repository/issue_write/create_branch/create_or_update_file/create_pull_request) all 7 tools absent from the 23-tool read-only catalog BLOCKED ⚠️
C CLI reads (github CLI proxy: list_issues, get_file_contents) data returned (200) ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) gh not authenticated (gh auth status reports no logged-in hosts) — not attempted BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh not authenticated — not attempted BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: the gateway's GitHub MCP tool catalog only exposes 23 read tools (get_commit, get_file_contents, get_label, get_latest_release, get_release_by_tag, get_tag, issue_read, list_branches, list_commits, list_issue_fields, list_issue_types, list_issues, list_pull_requests, list_releases, list_repository_collaborators, list_starred_repositories, list_tags, pull_request_read, search_code, search_commits, search_issues, search_pull_requests, search_repositories). No write tool targets were present, so refusal could not be independently attributed to mcpg's own gateway-level enforcement vs. gh-aw's backend GITHUB_READ_ONLY=1 config — per the task's own architectural note this is expected and structurally cannot exercise mcpg's independent DIFC/guard layer via this surface.

⚠️ Parts D/E: gh CLI is unauthenticated in this environment (gh auth status → no logged-in hosts), so REST/GraphQL write attempts could not be made to validate the token-scope boundary. No writes were attempted or retried.

No reaction, star, issue, comment, branch, file, or PR was created or leaked in any part of this run.

🔒 mcpg read-only stress (default AWF runtime) by Read-Only Stress: default runtime

@lpcox
lpcox merged commit e9793c1 into main Nov 7, 2026
28 checks passed
@lpcox
lpcox deleted the test-improver/cmd-testify-1794020057-d00006dbc141deb1 branch November 7, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants