Skip to content

test: real-hardware conformance corpus + opt-in hardware lane#22

Merged
CameronBrooks11 merged 1 commit into
mainfrom
test/hardware-lane-and-corpus
Jun 28, 2026
Merged

test: real-hardware conformance corpus + opt-in hardware lane#22
CameronBrooks11 merged 1 commit into
mainfrom
test/hardware-lane-and-corpus

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

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:

  • devs (and CI) run the full suite with no board, and
  • there's a dedicated, opt-in way to validate on real hardware.

What

Hardware-free conformance corpustests/conformance/*.trace are real sessions captured from the board (the > tx / < rx format TracingTransport emits). test_conformance.py replays them through FakeTransport.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, bare ok). No board needed.

Opt-in hardware lanetests/hardware/ (@pytest.mark.hardware) runs live connect / query / stream / e-stop-recovery against a real controller. conftest.py collects but skips these unless --port is supplied, so CI and offline work never touch hardware:

uv run pytest                                   # 110 passed, 4 hardware skipped
uv run pytest tests/hardware --port /dev/ttyACM0   # live: 4 passed

Validation

Capture loop for future traces is documented in tests/conformance/README.md (wrap in TracingTransport; see working/bringup.py).

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).
@CameronBrooks11
CameronBrooks11 merged commit d2bca64 into main Jun 28, 2026
5 checks passed
@CameronBrooks11
CameronBrooks11 deleted the test/hardware-lane-and-corpus branch June 28, 2026 00:23
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.

1 participant