[QA] Strengthen CommunicationManager tests with real protobuf contracts - #77
Merged
Merged
Conversation
Haralishev77
approved these changes
Mar 29, 2026
Haralishev77
added a commit
that referenced
this pull request
Jul 21, 2026
…ts (#77) * [QA] Strengthen CommunicationManager tests with real protobuf contracts * [QA] Strengthen CommunicationManager tests with real protobuf contracts * [style] Add comments with the empty exceptions --------- Co-authored-by: Khoroshilov Grigoriy <khorogri@gmail.com> Co-authored-by: Grigoriy Khoroshilov <101859570+Haralishev77@users.noreply.github.com>
meaning-0f-life
pushed a commit
to meaning-0f-life/OpenCDA
that referenced
this pull request
Jul 25, 2026
…ts (CAVISE#77) * [QA] Strengthen CommunicationManager tests with real protobuf contracts * [QA] Strengthen CommunicationManager tests with real protobuf contracts * [style] Add comments with the empty exceptions --------- Co-authored-by: Khoroshilov Grigoriy <khorogri@gmail.com> Co-authored-by: Grigoriy Khoroshilov <101859570+Haralishev77@users.noreply.github.com>
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.
Summary
Strengthen
CommunicationManagerunit tests by validating real protobuf contracts (serialized bytes →proto_capi.Messageparsing, oneof arm selection,orderhandling) while keeping ZeroMQ fully mocked (no network I/O).The test suite also auto-prepares protobuf Python modules when missing/stale via the existing toolchain, and cleans up any newly generated artifacts to avoid polluting the working tree.
Motivation
CommunicationManageris an infrastructure component where regressions are easy to introduce and hard to detect (socket identity/timeouts, reply validation, message ordering). Earlier tests were not sufficiently tied to the real protobuf schema, so certain proto changes (field removal/oneof reshaping) could slip through unnoticed.This PR makes the tests schema-sensitive by parsing and asserting against real generated protobuf message classes, while preserving deterministic and CI-friendly execution in minimal environments.
Changes
opencda/core/common/communication/test/test_communication_manager.pyto:zmqviasys.modules(no real sockets / no network);proto_capi.Message;opencda/artery),order, andmessage_orderinvariants;proto_capi.Message;CommunicationToolchain(only when required);sys.pathto support top-level imports inside generated code;How to run