Skip to content

ci(coverage): enable messaging_bridge in coverage build#989

Merged
kcenon merged 1 commit into
developfrom
feat/issue-953-enable-messaging-bridge-coverage
Apr 17, 2026
Merged

ci(coverage): enable messaging_bridge in coverage build#989
kcenon merged 1 commit into
developfrom
feat/issue-953-enable-messaging-bridge-coverage

Conversation

@kcenon

@kcenon kcenon commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Relates to #953

What

Flip BUILD_MESSAGING_BRIDGE from OFF to ON in .github/workflows/coverage.yml
so src/integration/messaging_bridge.cpp is included in coverage measurement.

-DBUILD_WITH_CONTAINER_SYSTEM=ON \
--DBUILD_MESSAGING_BRIDGE=OFF \
+-DBUILD_MESSAGING_BRIDGE=ON \
-DBUILD_TESTS=ON \

Why

Epic #953 (Expand unit test coverage from 40% to 80%) identified that the current
coverage workflow compiles out several BUILD_WITH_* paths, making the 62.4%
baseline a lower bound rather than a true line-coverage figure.

Most of the switches listed in #953 Step 1 are already ON today
(BUILD_WITH_COMMON_SYSTEM, BUILD_WITH_LOGGER_SYSTEM, BUILD_WITH_THREAD_SYSTEM,
BUILD_WITH_CONTAINER_SYSTEM), and branch coverage is already wired through
--rc lcov_branch_coverage=1 and --branch-coverage. The only remaining gap is
BUILD_MESSAGING_BRIDGE=OFF, which this PR flips.

Where

  • .github/workflows/coverage.yml — line 145 only

How

  • messaging_bridge.cpp is guarded by KCENON_WITH_THREAD_SYSTEM and
    KCENON_WITH_CONTAINER_SYSTEM macros; both systems are already fetched and
    built by the workflow (see the Checkout thread_system and
    Checkout container_system steps, and the tier-ordered dependency build).
  • No new repository checkout is required — the bridge is a compatibility layer
    internal to network_system, not a dependency on an external messaging_system
    repository.
  • After this PR merges on develop, the coverage workflow re-runs and produces
    a fresh baseline (line + branch) that will be recorded as a comment on Expand unit test coverage from 40% to 80% #953
    to satisfy the "Re-measured line coverage is recorded on this issue" AC.

Test Plan

  • CI runs the Code Coverage workflow on this PR (trigger includes
    pull_request: branches: [main, develop]).
  • Verify the job compiles with BUILD_MESSAGING_BRIDGE=ON without errors.
  • Verify lcov reports a non-zero line count for src/integration/messaging_bridge.cpp.
  • Verify the posted coverage comment shows both line and branch percentages.

Scope Note

This PR is intentionally narrow (one-line change). It is not a full
resolution of #953 — the epic still needs Step 2 (narrow single-file
test-expansion issues against the new baseline) before it can close.
Linked as Relates to rather than Closes for that reason.

The coverage workflow disabled BUILD_MESSAGING_BRIDGE, excluding
src/integration/messaging_bridge.cpp from line coverage measurement.
The bridge is guarded by KCENON_WITH_THREAD_SYSTEM and
KCENON_WITH_CONTAINER_SYSTEM; both ecosystem dependencies are already
checked out and built by the workflow, so enabling the bridge only
adds the bridge translation unit to the coverage instrumentation.

Relates to #953
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Metric Value
Line Coverage 63.8%
Branch Coverage 30.5%
Target 80% lines / 70% branches
Coverage Details

Full HTML report is available as a build artifact.

@kcenon kcenon merged commit 62487c3 into develop Apr 17, 2026
14 checks passed
@kcenon kcenon deleted the feat/issue-953-enable-messaging-bridge-coverage branch April 17, 2026 04:46
kcenon added a commit that referenced this pull request Apr 26, 2026
Adds tests/unit/quic_socket_branch_test.cpp with 53 hermetic test cases
exercising public-API surfaces of src/internal/quic_socket.cpp that
remained uncovered after Issue #989. Targets the #953 acceptance bar of
line >= 70% / branch >= 60%.

Coverage includes: short-lived construction loops for both client and
server roles; default invariants for state, role, is_connected,
is_handshake_complete, remote_endpoint, remote_connection_id;
local_connection_id RFC 9000 length bounds and pairwise uniqueness
across 16 sockets; callback registration with default-constructed,
replaced, and shared_ptr-captured handlers for all four callback types;
mutable and const socket() accessor reachability; role-guard rejection
in connect/accept (server-cannot-connect with and without SNI,
client-cannot-accept with empty and missing PEM paths, repeated
rejection idempotency); close() idempotency on idle/draining/closed
including triple-close, application-error-code branch with max-uint64
and 1024-character reason; send_stream_data not-connected guard;
create_stream not-connected guard for client/server bidi/uni;
close_stream not_found early-return for nine unknown ids;
start_receive/stop_receive flag transitions; move construction and
move assignment with populated callbacks; self-move-assignment via
reference; concurrent state-query polling and concurrent callback
replacement under shared_ptr lifetime; multi-instance independent
state; destructor cleanup paths.

Honest scope: the impl-level methods that physically exchange QUIC
packets with a peer (do_receive, handle_packet, process_frame and
its dispatch branches, process_crypto_frame, process_stream_frame,
process_ack_frame, process_connection_close_frame,
process_handshake_done_frame, send_pending_packets populated path,
send_packet encryption + async_send_to dispatch, queue_crypto_data
populated state, determine_encryption_level per-packet-type dispatch,
on_retransmit_timeout) require a live UDP/QUIC peer and remain
uncovered without a transport fixture. The connect()/accept() success
paths past TLS init also need a peer or PEM files on disk.

Closes #1051
Part of #953
kcenon added a commit that referenced this pull request Apr 26, 2026
* test(quic): add branch coverage tests for quic_server.cpp

Add tests/unit/quic_server_branch_test.cpp complementing
experimental_quic_server_test.cpp (Issue #989). Covers public-API
surfaces of messaging_quic_server reachable without a live QUIC peer:

- quic_server_config full-field round-trips: empty/1024-char/binary-byte
  cert/key paths, optional ca_cert_file present and absent,
  require_client_cert toggling, ALPN protocol vector growth (empty,
  single, four-with-empty-string, 32-entry), all six numeric settings
  at zero and std::numeric_limits boundaries, enable_retry toggle,
  retry_key vector growth (empty, 16, 256 bytes), full-config copy
  round-trip preserving every field
- Construction with empty / 512-char / binary-byte server IDs,
  16-iteration short-lived loops, server_id() reference stability
- Default-state queries on a never-started server: is_running,
  session_count, connection_count, sessions, get_session
- stop_server() rejection branch when never started, repeated rejection
  idempotency, i_quic_server::stop() interface delegation
- disconnect_session() not_found branch for unknown/empty/long/binary
  ids and varied error codes
- disconnect_all() empty-map no-op for varied error codes
- broadcast() and multicast() empty-map ok-return for empty/small/64KiB
  payloads, repeated invocation, empty session_ids, many unknown ids
- Legacy callback registration with empty std::function / triple
  replacement / shared_ptr capture for all five callback types
- Interface (i_quic_server) callback adapters for all five callbacks
  with null callbacks, populated lambdas, triple replacement
- Concurrent polling of is_running / session_count / server_id /
  sessions and concurrent legacy callback replacement under shared_ptr
- Multi-instance independent default state across 8 servers
- Destructor on never-started, after failed-stop, with callbacks
  registered

The impl-level packet-driven paths (do_start_impl, do_stop_impl,
start_receive, handle_packet, find_or_create_session, on_session_close,
start_cleanup_timer, cleanup_dead_sessions, all five invoke_*_callback
helpers, populated-map broadcast/multicast/disconnect_session/
disconnect_all branches) require a live QUIC client that completes a
TLS handshake or a friend-declared injection point and remain
uncovered.

Register network_quic_server_branch_test in tests/CMakeLists.txt.
Update CHANGELOG.md and docs/CHANGELOG.md.

Closes #1052
Part of #953

* test(quic): rename namespace alias iface to qiface to avoid Linux net/if.h struct iface conflict
kcenon added a commit that referenced this pull request Apr 26, 2026
…1059)

Add tests/unit/websocket_server_branch_test.cpp exercising public-API
surfaces of messaging_ws_server that remained uncovered after Issue #989
baseline measurement (line 39.9% / branch 19.7%).

Coverage targets:
- ws_server_config full-field round-trip (port / max_connections /
  ping_interval / max_message_size at zero / 1 / max boundaries, path
  with empty / 1024-char / binary-byte values, auto_pong toggle)
- messaging_ws_server construction with empty / 512-char / binary-byte
  server IDs and string_view literal variant
- Default-state queries on never-started server (is_running,
  connection_count, get_connection, get_all_connections)
- stop_server() / i_websocket_server::stop() returning ok() on
  prepare_stop() early-return branch
- broadcast_text() / broadcast_binary() session_mgr_ == nullptr
  early-return for empty / small / 64 KiB payloads
- Interface (i_websocket_server) callback adapters for connection /
  disconnection / text / binary / error with null callbacks (empty-
  function branch), populated lambdas, triple replacement, shared_ptr-
  captured state, and null-then-populated-then-null toggle
- Concurrent state queries and callback replacement under shared_ptr
- Multi-instance independent state and type alias coverage
- Destructor cleanup paths

Tests are hermetic: no live TCP peer, no WebSocket handshake. The impl-
level methods that exchange frames remain reachable only with a
transport fixture; this PR documents them in an honest scope statement.

Closes #1053
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