test: raise coverage of cmd/mcpcurl, internal/ghmcp and pkg/http helpers#14
Draft
israel2606 wants to merge 7 commits into
Draft
test: raise coverage of cmd/mcpcurl, internal/ghmcp and pkg/http helpers#14israel2606 wants to merge 7 commits into
israel2606 wants to merge 7 commits into
Conversation
This workflow installs Python dependencies, runs tests, and lints code with multiple Python versions.
Document the architecture, build/test workflow, toolset registration pattern, parameter helpers, error handling conventions, and contribution flow so AI assistants can act productively in this repo without re-discovering conventions. https://claude.ai/code/session_018psjWyFFcz83JXdxBQMUdd
…pers Raise cmd/mcpcurl coverage from ~9% to ~55% by testing the pure-logic helpers, in a separate file from the existing main_test.go: - buildArgumentsMap: all property types (string/number/integer/boolean, string arrays, object arrays via -json) plus the JSON-parse error path. - addCommandFromTool: flag registration, required flags, and enum PreRunE validation. - buildJSONRPCRequest: request envelope shape. - printResponse: plain, pretty-object, JSONL-array, empty, and invalid-JSON. https://claude.ai/code/session_01W9xh1kJCqtHqBgBAMQikon
Add internal/ghmcp/feature_checker_test.go covering createFeatureChecker: enabled+allowed flags resolve true, unknown/non-allowlisted/not-enabled flags resolve false (no error), and insiders mode enables the insiders set. https://claude.ai/code/session_01W9xh1kJCqtHqBgBAMQikon
Offline coverage work (not pushed): - pkg/http/transport: UserAgentTransport, BearerAuthTransport (incl. the GraphQL-Features-from-context path) -> RoundTrip 100%, package 46.7%->100%. - pkg/http/mark: With/Is/As/Unwrap/Error -> 100%. No production code changes.
✅ Deploy Preview for neon-toffee-d6b114 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for cosmic-quokka-b1b316 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ort tests Address golangci-lint findings on the new transport tests: - bodyclose: close resp.Body after RoundTrip in all three cases. - revive(context-as-argument): make context.Context the first parameter of the newRequest test helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Pure-logic test coverage across three low-coverage areas. No production code changes — test files only.
cmd/mcpcurl(buildArgumentsMap, addCommandFromTool, buildJSONRPCRequest, printResponse)internal/ghmcpcreateFeatureCheckerpkg/http/transport(UserAgent + Bearer round-trippers, incl. GraphQL-Features-from-context)pkg/http/mark(With/Is/As/Unwrap/Error)All tests are offline/pure (no network): cobra flag→args mapping, JSON-RPC envelope, response pretty-printing, feature-flag resolution, header-setting round-trippers, and error-marking semantics.
Verification
Note on CI
The only red checks are
build (3.9/3.10/3.11)— a Python workflow that runspyteston this Go repo and fails on every PR (collects 0 tests → exit 5). Pre-existing and unrelated to these tests; all Go checks (build matrix, lint, docs-check, mcp-diff) are green.🤖 Generated with Claude Code