Skip to main content

Module testmatrix

Module testmatrix 

Source
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-testmatrix dependency edge (it is dep: 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 testmatrix feature 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 testmatrix is OFF — the release path.
emit_facet_probe
No-op shape compiled when testmatrix is OFF — the release path.
emit_non_blank
No-op shape compiled when testmatrix is OFF — the release path.
emit_render
No-op shape compiled when testmatrix is OFF — the release path.
probe_and_emit
One-shot convenience: probe_facet the pane through msgs, then emit_facet_probe the 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.