Skip to content

[test-improver] Improve tests for oidc Provider - #15996

Merged
lpcox merged 1 commit into
mainfrom
test-improver/oidc-provider-testify-fc8b441cd80a7618
Nov 5, 2026
Merged

lpcox merged 1 commit into
mainfrom
test-improver/oidc-provider-testify-fc8b441cd80a7618

Conversation

@github-actions

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

Copy link
Copy Markdown
Contributor

File: internal/oidc/provider_test.go

Improvements

  • Replaced manual t.Error/t.Errorf checks in the hijacking test handler with assert.True/assert.NoError.
  • Replaced a panic on json.Marshal failure in TestProvider_JWTWithoutExpiry with require.NoError.

Coverage: 100% before and after (the package was already fully covered).

Verification: go vet, gofmt -l, and go test -count=3 ./internal/oidc/ all pass.

Generated by Test Improver · copilot · auto · ~21 AIC · ⊞ 9.3K · ◷

@lpcox
lpcox marked this pull request as ready for review November 5, 2026 15:43
Copilot AI adaptive review requested due to automatic review settings November 5, 2026 15:43

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 changes are limited to improving error handling and assertion consistency in OIDC provider tests, with no production behavior changes or active review issues identified.

No open issues 🎉

What changed in this PR

This pull request improves assertion consistency and error handling in OIDC provider tests without changing production behavior or coverage.

This pull request is ready to be approved.

Changes:

  • Replaces panic after json.Marshal failure with require.NoError.
  • Replaces manual error reporting in the hijacking test with Testify assertions.
  • Preserves the existing 100% package coverage.
File Description
internal/​oidc/​provider_test.go Replaces panic and manual test error handling with consistent Testify assertions.

Review effort: Lite (auto)

@github-actions

github-actions Bot commented Nov 5, 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 ALLOWED ✅
B MCP writes (reaction/star/issue/comment/branch/file/PR) all 6 write tools absent from catalog (only 23 read tools exposed); no write possible BLOCKED ⚠️
C CLI reads via proxied 'github' CLI data returned ALLOWED ✅
D CLI REST writes (reaction/star/issue/comment) gh CLI unauthenticated in this environment; writes not attempted BLOCKED ⚠️
E CLI GraphQL mutations (addReaction/addStar/createIssue) gh CLI unauthenticated; mutations not attempted BLOCKED ⚠️

Overall: INCONCLUSIVE

⚠️ Part B: all 6 targeted write tools (add_issue_comment, star_repository, issue_write, create_branch, create_or_update_file, create_pull_request) were entirely absent from the MCP tool catalog exposed via the proxied 'github' CLI (only 23 read-only tools listed). This confirms gh-aw's backend GITHUB_READ_ONLY=1 config but does not independently exercise the gateway's own DIFC/guard write-blocking layer, since no write tool call ever reached a write-capable backend.

⚠️ Parts D/E: 'gh' CLI was not authenticated in this job ("set the GH_TOKEN environment variable" error on every call), so the token-scope write boundary could not be exercised this run.

No write, reaction, star, issue, comment, branch, file, or PR was created or leaked in this run. No FAIL condition observed.

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

@lpcox
lpcox merged commit a6fa759 into main Nov 5, 2026
28 checks passed
@lpcox
lpcox deleted the test-improver/oidc-provider-testify-fc8b441cd80a7618 branch November 5, 2026 16:00
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