-
Notifications
You must be signed in to change notification settings - Fork 56
chore: Add protocol snapshot tests for the mqtt and local e2e tests. #697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Update the local tests to send the exact same binary format for the initial hello requests. This also adds L01 coverage.