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

nordisk/korp-collectors

tests/common/mod.rs

//! Shared test-matrix emit helper (in `tests/common/` so it is NOT compiled as
//! its own integration-test binary). Every real check in the sibling test files
//! calls [`emit`] / [`emit_for`] with a stable `check_id` + verdict; with
//! `--features testmatrix` that becomes a real `nornir_testmatrix::functional_status`
//! row (the nornir test-matrix reads them back), and without the feature it is a
//! compiled-out no-op (no nornir dep in the default build). Same pattern holger
//! uses (`nornir_testmatrix::{functional_row, status}`).

#![allow(dead_code)]

/// Emit one functional-status row for component `korp-collectors`. No-op unless
/// built `--features testmatrix`.
pub fn emit(check_id: &str, passed: bool, detail: &str) {
    emit_for("korp-collectors", check_id, passed, detail);
}

/// Emit under a per-collector component name (e.g. `"korp-collectors/dcat"`).
pub fn emit_for(component: &str, check_id: &str, passed: bool, detail: &str) {
    #[cfg(feature = "testmatrix")]
    nornir_testmatrix::functional_status(component, check_id, passed, detail);
    #[cfg(not(feature = "testmatrix"))]
    {
        let _ = (component, check_id, passed, detail);
    }
}