Skip to content

test(grpc): expand client.cpp coverage to 80% line / 70% branch #1063

Description

@kcenon

What

Expand unit-test coverage of src/protocols/grpc/client.cpp from 22.6% line / 9.5% branch to >= 80% line / >= 70% branch (per coverage.yml).

Existing tests in tests/test_grpc_client_server.cpp (added via #994) cover happy paths only; this issue adds error-path and branch-coverage tests.

Why

  • Part of #953 — project-wide coverage push to 80%/70%.
  • Priority feat: Phase 2 - Core System Separation #2 worst-coverage target in the 2026-04-26 re-measurement (run 24947193873).
  • gRPC client error handling (deadline exceeded, status mapping, stream cancellation) is unverified.

Where

  • File: src/protocols/grpc/client.cpp (~482 lcov-executable lines)
  • Tests: extend tests/test_grpc_client_server.cpp and related (test_grpc_frame.cpp, test_grpc_service_registry.cpp)
  • Coverage workflow: .github/workflows/coverage.yml

How

Technical Approach

  1. Read client.cpp / client.h to enumerate public API and error branches.
  2. Identify uncovered lines/branches via the 2026-04-26 lcov report.
  3. Add tests for:
    • Status code mapping (gRPC status → Result<T>)
    • Deadline / cancellation propagation
    • Streaming RPC error paths (server-streaming, client-streaming, bidi)
    • Metadata frame edge cases (oversize, malformed)
  4. Reuse the in-process gRPC test harness; do not introduce real network mocks.

Acceptance Criteria

  • src/protocols/grpc/client.cpp line coverage >= 80%
  • src/protocols/grpc/client.cpp branch coverage >= 70%
  • Tests pass on Ubuntu/macOS/Windows CI
  • Sanitizer builds (ASAN, TSAN, UBSAN) pass
  • Post-merge coverage delta recorded on Expand unit test coverage from 40% to 80% #953

Part of #953

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions