ESPSomfy-RTS/test/e2e
cjkas 8fa087aa89 fix: edit ops review findings
From the review of 7723711:
- The assembler is locked: a client closed for a full queue is closed
  by the task that was sending, loop(), whose disconnect dropped the
  buffer while async_tcp could be copying into it. A whole message is
  taken out of it, so a disconnect can't free it while it is read.
- loop() expires a message stalled for 10 s, freeing its buffer and
  telling its client, instead of holding it until another client came.
  A binary message is refused before it can touch another's buffer.
- Each edit takes only the fields its route reads; one it would ignore
  is refused by name. linkRemote's rolling code goes in under the
  route's name, so applyModelEdit is unchanged again.
- An edit refused for an id that doesn't exist replies not found
  (edit_result_t::missing). A reply that doesn't fit its buffer goes
  as an internal error, so the op still gets one.
- The TYPE table says what becomes of each op (proto_op_t), which the
  socket switches on. The reply address is one proto_reply_to_t. The
  routes and the ops start and queue an edit the same way
  (newModelEdit, submitModelEdit). The full-list texts and the offered
  remote address rule live in ModelEditor.
- e2e: the sort order test skips a list that it would renumber.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 18:10:06 +02:00
..
conftest.py feat: edit ops and the reads their forms need, for socket protocol 2 2026-10-24 14:29:53 +02:00
proto_client.py test: start the e2e suite for socket protocol 2 2026-10-24 11:03:07 +02:00
README.md feat: edit ops and the reads their forms need, for socket protocol 2 2026-10-24 14:29:53 +02:00
test_auth.py test: start the e2e suite for socket protocol 2 2026-10-24 11:03:07 +02:00
test_commands.py feat: command ops for socket protocol 2 2026-10-24 13:42:41 +02:00
test_edits.py fix: edit ops review findings 2026-10-24 18:10:06 +02:00
test_messages.py fix: protocol 2 core review findings 2026-10-24 13:17:15 +02:00
test_survival.py fix: protocol 2 core review findings 2026-10-24 13:17:15 +02:00
test_sync.py test: sync_waits_for_next lets events through 2026-10-24 13:40:08 +02:00

e2e suite

Runs against a real device on your network, by hand, never in CI. It checks socket protocol 2 (PROTOCOL.md) and that the device survives the loads that used to run its heap out.

~/.platformio/penv/Scripts/uv run --no-project --with pytest -- pytest test/e2e --device 192.168.1.120
Option Use
--device the device's address (required)
--password, --username / --pin the credentials of a Secured device
--radio --shade <id> also send real commands: that shade moves a little and back
--edit also add a room and delete it again
--record save hello, the sync and the schema to test/fixtures/proto2/, for the web UI and Home Assistant tests

A plain run sends nothing on air, changes no settings and doesn't reboot the device. The command tests send ops that are refused before they reach the radio, and one setPositions that sets a shade to the position the sync gave: that drops the fraction of a percent the shade's believed position may have had. The edit tests send edits that are refused, and one shade sort order set to the order it has, which saves the shades again unchanged. It does fill every socket slot for a few seconds, and replays a page load.

The tests run in whatever security mode the device is in; the suite never changes it. To test both modes, run the suite once in each.