Skip to content

Conversation

@allenporter
Copy link
Contributor

Update the local tests to send the exact same binary format for the initial hello requests. This also adds L01 coverage.

Copilot AI review requested due to automatic review settings December 21, 2025 18:43
Copy link
Contributor

Copilot AI left a 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.

@allenporter allenporter marked this pull request as draft December 23, 2025 03:13
Update the local tests to send the exact same binary format for the initial hello requests. This also adds L01 coverage.
@allenporter allenporter marked this pull request as ready for review December 23, 2025 05:58
@allenporter allenporter merged commit 6293a67 into Python-roborock:main Dec 23, 2025
25 of 28 checks passed
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.

2 participants