Context: Tier-a-is-honest evidence for the RoamCore Victron integration
(Bernard, 2026-08-04: "must not fail + super intuitive + critical
infrastructure"). Product Build Directive §"Verify every connection"
requires runtime verification that sensor.vt_battery_soc_percent updates
end-to-end via a real (or emulated) Venus OS MQTT broker. The bench is a
portable pytest that any maintainer can run on a dev box or in CI; it
boots VictronAuto against a real MQTT broker fixture, publishes fake
Venus OS D-Bus topics, asserts the vt_* HA MQTT discovery payloads appear,
and verifies end-to-end that the roamcore_power.yaml tile Jinja would
resolve to a real value.
Changes:
* homeassistant/addons/roamcore-victron-auto/src/main.py:
- Additive bench mode (VictronAuto.bench flag) + bench CLI subcommand.
- VictronStartupError exception class with plain-English copy
(starts with "Victron GX not found on your network") for the
bench smoke + the runtime error path.
- bench_run_once() method that connects both HA + Victron MQTT,
publishes discovery, and exits cleanly.
- _bench_connect_ha_mqtt_local() helper that connects to a
localhost broker without Supervisor calls.
- argparse-based main() entry point with `bench` subcommand.
* homeassistant/addons/roamcore-victron-auto/tests/ (NEW):
- conftest.py: pytest fixtures (mqtt_broker with mosquitto/amqtt
fallback, ha_discovery_recorder, victron_auto_instance,
victron_connected).
- test_victron_auto_bench.py: 12 tests covering connect, subscribe,
discovery payload shape, end-to-end SoC round-trip, recovery,
plain-English errors, idempotency, power-tile integration.
- pytest.ini: asyncio_mode=auto.
- README.md: IKEA-style 5-step setup + troubleshooting.
* homeassistant/addons/roamcore-victron-mock/src/main.py:
- argparse-based main() with --bench flag publishing a
deterministic SoC walk (10..100 step 10, repeating).
- --bench-interval and --bench-iterations knobs.
* homeassistant/addons/roamcore-victron-auto/requirements.txt:
- Add pytest, pytest-asyncio, amqtt as bench deps (commented docs).
* scripts/checks/victron-bench-smoke.sh (NEW): wires the bench into
check.sh, runs pytest, exits 0 on SKIP with a clear message.
* scripts/check.sh:
- Run victron-bench-smoke.sh on --core-only (tier-a-is-honest).
- Run it after victron-rc-contract.sh in full mode (per spec).
* docs/catalog/power/victron.md:
- §"Bench testing" IKEA-5: install, run, what it covers, real GX,
troubleshooting.
Verification:
- bash scripts/checks/victron-bench-smoke.sh: 12 passed in ~54s.
- bash scripts/check.sh --core-only: GREEN (all smoke checks
including the new victron bench).
- The bench SKIP path is exercised when paho-mqtt / amqtt are
missing (smoke script exits 0 with a clear "SKIP — install
paho-mqtt to run" message).
- All 12 acceptance criteria from the slice spec are met.
Rollback: git revert <sha>
Wave 9 #115: Power Victron bench integration tests
Context: Tier-a-is-honest evidence for the RoamCore Victron integration
(Bernard, 2026-08-04: "must not fail + super intuitive + critical
infrastructure"). Product Build Directive §"Verify every connection"
requires runtime verification that sensor.vt_battery_soc_percent updates
end-to-end via a real (or emulated) Venus OS MQTT broker. The bench is a
portable pytest that any maintainer can run on a dev box or in CI; it
boots VictronAuto against a real MQTT broker fixture, publishes fake
Venus OS D-Bus topics, asserts the vt_* HA MQTT discovery payloads appear,
and verifies end-to-end that the roamcore_power.yaml tile Jinja would
resolve to a real value.
Changes:
homeassistant/addons/roamcore-victron-auto/src/main.py:
(starts with "Victron GX not found on your network") for the
bench smoke + the runtime error path.
publishes discovery, and exits cleanly.
localhost broker without Supervisor calls.
benchsubcommand.homeassistant/addons/roamcore-victron-auto/tests/ (NEW):
fallback, ha_discovery_recorder, victron_auto_instance,
victron_connected).
discovery payload shape, end-to-end SoC round-trip, recovery,
plain-English errors, idempotency, power-tile integration.
homeassistant/addons/roamcore-victron-mock/src/main.py:
deterministic SoC walk (10..100 step 10, repeating).
homeassistant/addons/roamcore-victron-auto/requirements.txt:
scripts/checks/victron-bench-smoke.sh (NEW): wires the bench into
check.sh, runs pytest, exits 0 on SKIP with a clear message.
scripts/check.sh:
docs/catalog/power/victron.md:
troubleshooting.
Verification:
including the new victron bench).
missing (smoke script exits 0 with a clear "SKIP — install
paho-mqtt to run" message).
Rollback: git revert