ci(coverage): enable messaging_bridge in coverage build#989
Merged
Conversation
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
Contributor
Coverage Report
Coverage DetailsFull HTML report is available as a build artifact. |
This was referenced Apr 17, 2026
This was referenced Apr 24, 2026
This was referenced Apr 26, 2026
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
4 tasks
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
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.
Relates to #953
What
Flip
BUILD_MESSAGING_BRIDGEfromOFFtoONin.github/workflows/coverage.ymlso
src/integration/messaging_bridge.cppis included in coverage measurement.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
ONtoday(
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=1and--branch-coverage. The only remaining gap isBUILD_MESSAGING_BRIDGE=OFF, which this PR flips.Where
.github/workflows/coverage.yml— line 145 onlyHow
messaging_bridge.cppis guarded byKCENON_WITH_THREAD_SYSTEMandKCENON_WITH_CONTAINER_SYSTEMmacros; both systems are already fetched andbuilt by the workflow (see the
Checkout thread_systemandCheckout container_systemsteps, and the tier-ordered dependency build).internal to
network_system, not a dependency on an externalmessaging_systemrepository.
develop, the coverage workflow re-runs and producesa 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
Code Coverageworkflow on this PR (trigger includespull_request: branches: [main, develop]).BUILD_MESSAGING_BRIDGE=ONwithout errors.src/integration/messaging_bridge.cpp.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 torather thanClosesfor that reason.