Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/edda

crates/nornir-testmatrix/Cargo.toml

[package]
name = "nornir-testmatrix"
version = "0.2.13"
edition = "2024"
rust-version = "1.85"
description = "Reusable, multi-aspect Rust test-matrix engine: wrap a repo's native cargo test/nextest plus build/clippy/fmt/audit/coverage/doctest aspects, parse the results into rows, and ship them to any TestSink. Pure std + serde — no iceberg, arrow, eframe. The portable core of nornir's `nornir test` matrix."
license = "MIT OR Apache-2.0"
repository = "https://git.gunnar.rs/nordisk/edda"
readme = "README.md"
keywords = ["cargo", "test", "matrix", "ci", "clippy"]
categories = ["development-tools::cargo-plugins", "development-tools::testing"]
# Keep the published crate lean: the .nornir design/runtime dir is not part of
# the library.
exclude = ["/.nornir/"]

[dependencies]
# The ONLY deps — the crate must stay heavy-dep-free (no iceberg/arrow/eframe/
# tantivy/skade) so leaf repos pull it cheaply.
serde = { version = "1", features = ["derive"] }
serde_json = "1"
anyhow = "1"

[features]
# `testmatrix` — the functional-status MODE. When ON, `functional_status(...)`
# records a component's self-reported pass/fail into a process-global buffer that
# `drain_functional_rows()` turns into `Aspect::Functional` `test_results` rows
# for the matrix. When OFF (the release default), `functional_status` compiles to
# a `#[inline]` empty stub — zero release cost. Consumers that build a *detail*
# string (formatting, scene walks) should still wrap the call site in
# `#[cfg(feature = "testmatrix")]` so that work is also stripped in release.
#
# Default is empty: release builds never opt in. CI / dev / the `nornir test`
# matrix build with `--features testmatrix`.
default = []
testmatrix = []

[dev-dependencies]
# The DECLARATIONS. Enumerated and built THROUGH this library, in-process —
# never a hand-rolled cargo line and never a `nornir` subprocess.
#
# ⚠ It MUST be a dev-dependency and can never be a normal one. MEASURED
# 2026-08-15: `cargo metadata` refuses the normal edge with
# `cyclic package dependency`, because nornir-build-thing → nornir-git →
# nornir-hash → nornir-testmatrix closes a loop back onto this crate. Cargo
# tolerates the cycle only through [dev-dependencies], which is also how
# nornir-build-thing itself depends on this crate.
nornir-build-thing = { path = "../nornir-build-thing" }
# The `service` KIND's instantiation + answer seam — 12 of the 44 chain-matrix
# rows. `tests/chain_matrix.rs` drives a real `systemd --user` unit through
# `skidbladnir::service_drive::ServiceDrive` (pure-Rust D-Bus via zbus — NO
# `systemctl` subprocess) and reuses `draupnir::Seen` + Skidbladnir's
# `DriveReport` rather than twinning a second readiness vocabulary.
#
# It lives HERE, in [dev-dependencies], for TWO reasons and only the second is a
# cycle:
#
#  1. THE CHARTER (the binding reason). The [dependencies] block above is capped
#     at serde + serde_json + anyhow so a leaf repo pulls this crate cheaply.
#     skidbladnir/service-drive pulls zbus + draupnir + tar + zstd + blake3 + ron,
#     which is exactly the weight that block exists to keep out. So the binding
#     goes in the same dev-dependency/adapter place as `nornir-build-thing`,
#     behind the `ChainArms` trait seam — one `impl`, swappable by any caller.
#  2. NO CYCLE, MEASURED 2026-08-15. Unlike nornir-build-thing, this edge does
#     NOT close a loop: `cargo metadata --format-version 1` (full resolve) exits
#     0 and `cargo build --tests` finishes, even though Skidbladnir names this
#     crate back in both its optional [dependencies] and its [dev-dependencies]
#     — cargo tolerates that because the return edge is only reached through a
#     dev edge. Recorded so nobody re-derives it the hard way.
#
# ⚠ REGISTRY, NOT PATH (2026-08-27). Reason (2) above measured the CRATE graph and
# it is still true — there is no cycle. The failure it did not measure is PATH
# IDENTITY, and this is the FOURTH instance of it in this repo: `nornir-guard` in
# nornir-release-core (2026-07-31), `skidbladnir` in nornir-build-thing
# (2026-07-31), `nornir-introspect` in nornir-docgen (03ac347), and this line.
# `path = "../../../Skidbladnir"` resolved relative to THIS manifest, so from any
# non-canonical checkout of edda it reached the one real sibling, whose own
# `path = "../edda/crates/nornir-escape"` then reached the MAIN edda checkout —
# one package at two paths, and cargo refuses to write a lockfile at all:
#
#   error: package collision in the lockfile: packages nornir-escape v0.1.0
#   (<mirror>/crates/nornir-escape) and nornir-escape v0.1.0
#   (~/git/edda/crates/nornir-escape) are different, but only one
#   can be written to lockfile unambiguously
#
# MEASURED 2026-08-27 on a hardlink mirror of the working tree placed beside the
# siblings (the same probe `no_path_dep_on_our_consumer.rs` runs): `cargo
# metadata` exit 101 with that collision BEFORE this line changed, exit 0 after,
# with nothing else touched. `cargo check -p nornir-testmatrix --tests` and
# `--test chain_matrix` both compile against the published 0.1.15, so the
# service-drive surface the chain matrix uses is all in the registry copy. ONE
# line was the whole reason edda could not be built from a worktree, on a fleet
# that works in worktrees by design.
#
# Same fix and same shape as nornir-build-thing:156 (`skidbladnir = { version =
# "0.1.12", optional = true }`): a published version has no path identity. The
# floor is 0.1.15 because that is what the chain matrix was verified against; the
# local checkout is 0.1.14, so this deliberately builds the test against the
# REGISTRY copy rather than against whatever is in the sibling working tree —
# which is exactly the property being bought.
#
# `default-features = false` drops Skidbladnir's default `pki` (rcgen/ed25519):
# the chain matrix drives units, it does not mint certificates.
skidbladnir = { version = "0.1.15", default-features = false, features = [
    "service-drive",
] }

# Throwaway git fixtures for the citation audit's own unit tests — real repos
# with real `git worktree` links, because the property under test (a linked
# worktree resolves the REPOSITORY's siblings, not the directory's neighbours)
# is a property of git's plumbing and cannot be faked with a directory tree.
tempfile = "3"