Skip to content

Close remaining mcp_proxy coverage gaps#139

Merged
scottscott merged 3 commits intonomoticai:mainfrom
scottscott:feat/mcp-proxy-coverage-followup
Mar 20, 2026
Merged

Close remaining mcp_proxy coverage gaps#139
scottscott merged 3 commits intonomoticai:mainfrom
scottscott:feat/mcp-proxy-coverage-followup

Conversation

@scottscott
Copy link
Collaborator

Summary

Follow-up to merged PR #138: close the remaining nomotic.mcp_proxy coverage gaps with focused HTTP run-path tests.

Key Changes

  • Add targeted tests in tests/test_mcp_proxy.py for:
    • certificate-required POST path with missing identity (403)
    • certificate-required POST path with invalid certificate (403)
    • certificate-id header identity resolution path
    • allowed tool-call forwarding path
    • response serialization branches for bytes and str bodies
    • debug log_message branch
    • shutdown signal handler path (_shutting_down + timer start)

Validation

  • pytest -q tests/test_mcp_proxy.py --cov=nomotic.mcp_proxy --cov-report=term-missing:skip-covered
    • 79 passed
    • nomotic.mcp_proxy: 100% coverage in this targeted run

Notes

Add targeted HTTP run-path tests for certificate-required POST handling, allowed tool-call forwarding, bytes/str response serialization, debug request logging, and shutdown signal timer behavior.

Raises nomotic.mcp_proxy coverage to 100% in test_mcp_proxy run.

assisted-by: GitHub Copilot
@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Add retry logic for HTTP integration helper requests in TestMCPHTTPGovernanceProxyRunIntegration to handle rare macOS CI ConnectionResetError/BrokenPipeError race conditions.

Keeps assertions unchanged while reducing nondeterministic failures.

assisted-by: GitHub Copilot
Avoid flaky body-read socket reset behavior on macOS by using status-only request assertions for certificate-required integration paths, while preserving branch coverage and certificate verification assertions.

assisted-by: GitHub Copilot
@scottscott scottscott merged commit 76cc348 into nomoticai:main Mar 20, 2026
8 checks passed
@scottscott scottscott deleted the feat/mcp-proxy-coverage-followup branch March 20, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant