Expand description
The functional-status → nornir test-matrix bridge (feature testmatrix).
This is the single, discoverable seam every facett crate’s tests + self-test
/ headless-render paths use to feed the nornir test matrix one row per
real, meaningful check. It wraps [nornir_testmatrix::functional_status]
so a leaf crate’s test only has to call facett_core::testmatrix::emit(...)
(or emit_render) — it never has to depend on nornir-testmatrix
directly; this crate owns that edge.
§Gated so release strips it
Everything here is #[cfg(feature = "testmatrix")]. A facett crate adds a
passthrough testmatrix = ["facett-core/testmatrix"] and wraps each call in
#[cfg(feature = "testmatrix")]. So a release build (feature OFF):
- has no
nornir-testmatrixdependency edge (it isdep:optional), - compiles out every emit call site, and
- even a stray call would hit a no-op (the upstream function is itself a
no-op when its own
testmatrixfeature is off).
With --features testmatrix each call appends one functional row to the JSON
sink at $NORNIR_TESTMATRIX_OUT (default target/nornir-functional.json),
which nornir test reads back into the matrix. A blank / zero-geometry
render becomes a RED functional row (ok = false); a real render is green.
Functions§
- emit
- No-op shape compiled when
testmatrixis OFF — the release path. - emit_
facet_ probe - No-op shape compiled when
testmatrixis OFF — the release path. - emit_
non_ blank - No-op shape compiled when
testmatrixis OFF — the release path. - emit_
render - No-op shape compiled when
testmatrixis OFF — the release path. - probe_
and_ emit - One-shot convenience:
probe_facetthe pane throughmsgs, thenemit_facet_probethe result. The single line a leaf’s discovery test writes to give its pane a functional matrix cell. Returns the probe so the test can add pane-specific assertions on top.