Skip to main content

Module test_utils

Module test_utils 

Source
Expand description

Shared helpers for the integration-test suites of the consumer crates.

Backtrace and spantrace snapshots are platform- and toolchain-specific, so each snapshot is blessed and asserted only on the toolchain that produced it; the variance lives in the snapshot filename (channel + target triple) rather than in a cross-toolchain normalization battery. The filters here are therefore deliberately light: they only erase build-to-build noise (compilation hashes, line/column numbers, machine-specific paths).

Modules§

settings
insta snapshot redaction profiles that erase build-to-build noise (compilation hashes, line/column numbers, machine-specific paths) from backtrace and spantrace snapshots.

Constants§

CHANNEL
The toolchain channel (stable or unstable) embedded in snapshot file names so toolchain-specific snapshots stay in separate files.

Functions§

force_backtrace
Force backtrace capture on the current thread so snapshots are deterministic regardless of the ambient RUST_BACKTRACE environment.
init_test_subscriber
Install a test subscriber with an ErrorLayer so span traces are captured for the duration of the returned guard.
init_test_subscriber_without_error_layer
Install a test subscriber without an ErrorLayer, so captured span traces report Unsupported — distinct from the no-subscriber Empty case — for the duration of the returned guard.