chore: Add protocol snapshot tests for the mqtt and local e2e tests.#697
Merged
allenporter merged 7 commits intoPython-roborock:mainfrom Dec 23, 2025
Merged
chore: Add protocol snapshot tests for the mqtt and local e2e tests.#697allenporter merged 7 commits intoPython-roborock:mainfrom
allenporter merged 7 commits intoPython-roborock:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds protocol snapshot tests for the MQTT and local end-to-end tests to ensure binary protocol compatibility. The changes make the local tests send deterministic binary messages for initial hello requests, enabling regression testing of the wire protocol format. Additionally, L01 protocol coverage is added.
- Adds snapshot testing infrastructure using syrupy for MQTT and local e2e tests
- Updates local tests to use deterministic message generation for consistent binary snapshots
- Adds comprehensive L01 protocol test coverage including handshake fallback
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/mqtt_fixtures.py | Updates Subscriber type annotations to support both RoborockMessage and bytes |
| tests/e2e/test_mqtt_session.py | Adds snapshot assertions to existing MQTT session tests |
| tests/e2e/test_local_session.py | Refactors local session tests with snapshot support and adds new L01 protocol test |
| tests/e2e/snapshots/test_mqtt_session.ambr | New snapshot file capturing MQTT protocol binary exchanges |
| tests/e2e/snapshots/test_local_session.ambr | New snapshot file capturing local protocol binary exchanges including L01 |
| tests/conftest.py | Adds logging to FakeSocketHandler to capture requests/responses for snapshots |
| roborock/protocol.py | Makes ack_nonce parameter optional in _l01_aad and encrypt_gcm_l01 functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fb66718 to
b4413a0
Compare
Update the local tests to send the exact same binary format for the initial hello requests. This also adds L01 coverage.
b4413a0 to
be86e54
Compare
Lash-L
approved these changes
Dec 23, 2025
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.
Update the local tests to send the exact same binary format for the initial hello requests. This also adds L01 coverage.