test: real-hardware conformance corpus + opt-in hardware lane#22
Merged
Conversation
Establishes the mock/hardware separation for the test suite:
- Default suite stays 100% hardware-free. New conformance corpus
(tests/conformance/*.trace) holds sessions captured from a real RAMPS
1.4 / Marlin bugfix-2.1.x board, replayed via FakeTransport.from_trace
in test_conformance.py — pinning connect/M115-negotiation and streaming
against genuine wire output with no board attached.
- New opt-in hardware lane (tests/hardware/, @pytest.mark.hardware) runs
live connect/query/stream/e-stop-recovery against a real controller.
Gated in conftest.py: collected but skipped unless --port is given, so
CI and offline devs never need hardware. Run with:
uv run pytest tests/hardware --port /dev/ttyACM0
Validated: default run 110 passed / 4 hardware skipped; the live lane
passes 4/4 against the real board (incl. the #21 e-stop recovery).
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.
Why
First real-hardware bring-up (RAMPS 1.4 / Marlin
bugfix-2.1.x, no 12V) validated the host end-to-end. This captures that into the test suite with a clean mock / hardware separation:What
Hardware-free conformance corpus —
tests/conformance/*.traceare real sessions captured from the board (the> tx/< rxformatTracingTransportemits).test_conformance.pyreplays them throughFakeTransport.from_trace, pinning connect + M115 negotiation and streaming against genuine wire output (incl. this build's real dialect:EMERGENCY_PARSER:0,EEPROM:0,ARCS:1, bareok). No board needed.Opt-in hardware lane —
tests/hardware/(@pytest.mark.hardware) runs live connect / query / stream / e-stop-recovery against a real controller.conftest.pycollects but skips these unless--portis supplied, so CI and offline work never touch hardware:Validation
just checkclean.reset(flush=True)→ reconnect recovery from fix(transport): flush stale input on recovery reset #21.Capture loop for future traces is documented in
tests/conformance/README.md(wrap inTracingTransport; seeworking/bringup.py).