Testing
CI runs every test on every commit.
Running the tests
Section titled “Running the tests”cargo test --workspacecargo clippy --workspace --all-targets -- -D warningscargo fmt --all --checkUnit tests
Section titled “Unit tests”The data model tables, JSON to TLV and back for every kind of value, onboarding codes, the node store, Home Assistant discovery and the configuration.
End to end, against the reference device
Section titled “End to end, against the reference device”On every commit, CI starts connectedhomeip’s chip-all-clusters-app (from
the CSA’s chip-cert-bins image, on an arm64 runner) and runs
crates/matter-bridge/tests/e2e.rs against it. The test:
- commissions it over IP, finding it by DNS-SD from its manual code;
- checks the interview, the subscription’s first report and an event;
- checks Home Assistant discovery;
- reads, writes, and invokes a command whose effect comes back through the subscription, and one with a typed response;
- puts an endpoint in a group and toggles it with one multicast command;
- opens a commissioning window, through which a second controller on its own fabric commissions the device too.
The same test runs against any commissionable device on your network:
MATTER_E2E_CODE=34970112332 cargo test -p matter-bridge --test e2e -- --ignored --nocaptureThe docs workflow also runs the README’s quick start against the same device: the release binary and the current build, configured, started and commissioning with the README’s own commands.
Bluetooth commissioning
Section titled “Bluetooth commissioning”crates/matter-controller/tests/ble.rs commissions a Wi-Fi device over
Bluetooth LE between two virtual controllers from Bumble on every commit:
found by its advertisement, PASE over BLE, Wi-Fi credentials given, CASE
over IP. Thread commissioning is tested up to the request that hands the
dataset over; CI has no Thread device.
Fuzzing
Section titled “Fuzzing”The bridge’s own decoders of untrusted input have
cargo-fuzz targets in fuzz/:
the JSON encoder against every shape in the data model (with the round trip
as the oracle), onboarding codes, and Thread datasets. CI fuzzes them on
every commit. Locally (needs a nightly toolchain):
cargo install cargo-fuzzcargo +nightly fuzz listcargo +nightly fuzz run json_to_tlv -- -max_total_time=600Budgets
Section titled “Budgets”- Memory: under 16 MB resident with 100 nodes in the store
(
cargo test --release -p matter-controller --test budget -- --ignored). - Binary size: static
aarch64andmipselbuilds in CI.
Documentation
Section titled “Documentation”The docs workflow checks the claims this site makes: the
configuration reference is regenerated from the code
and compared, every doctest runs (the README’s and the library guide’s
examples among them), the README’s quick start runs, the workspace builds on
the minimum supported Rust version, and every relative link resolves.