nextest_runner/record/
mod.rs

1// Copyright (c) The nextest Contributors
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Recording infrastructure for nextest runs.
5//!
6//! This module provides functionality to record test runs to disk for later inspection
7//! and replay. The recording captures test events, outputs, and metadata in a structured
8//! archive format.
9//!
10//! # Architecture
11//!
12//! The recording system consists of:
13//!
14//! - [`RunStore`]: Manages the directory where recordings are stored, handling locking
15//!   and the list of recorded runs.
16//! - [`RunRecorder`]: Writes a single run's data to disk, including metadata and events.
17//! - [`RecordReader`]: Reads a recorded run from disk for replay or inspection.
18//! - [`records_cache_dir`]: Returns the platform-specific cache directory for recordings.
19//!
20//! # Archive format
21//!
22//! Each run is stored in a directory named by its UUID, containing:
23//!
24//! - `store.zip`: A zstd-compressed archive containing metadata and test outputs.
25//! - `run.log.zst`: A zstd-compressed JSON Lines file of test events.
26
27mod cache_dir;
28pub mod dicts;
29mod display;
30pub mod format;
31mod reader;
32mod recorder;
33pub mod replay;
34mod rerun;
35mod retention;
36mod run_id_index;
37mod session;
38mod store;
39mod summary;
40#[cfg(test)]
41pub(crate) mod test_helpers;
42mod tree;
43
44pub use cache_dir::{NEXTEST_CACHE_DIR_ENV, records_cache_dir};
45pub use display::{
46    DisplayPrunePlan, DisplayPruneResult, DisplayRecordedRunInfo, DisplayRecordedRunInfoDetailed,
47    DisplayRunList, RunListAlignment, Styles,
48};
49pub use format::RunsJsonWritePermission;
50pub use reader::{RecordEventIter, RecordReader};
51pub use recorder::{RunRecorder, StoreSizes};
52pub use replay::{
53    ReplayContext, ReplayConversionError, ReplayHeader, ReplayReporter, ReplayReporterBuilder,
54};
55pub use rerun::ComputedRerunInfo;
56pub use retention::{PruneKind, PrunePlan, PruneResult, RecordRetentionPolicy};
57pub use run_id_index::{RunIdIndex, RunIdSelector, ShortestRunIdPrefix};
58pub use session::{
59    RecordFinalizeResult, RecordFinalizeWarning, RecordSession, RecordSessionConfig,
60    RecordSessionSetup,
61};
62pub use store::{
63    CompletedRunStats, ComponentSizes, ExclusiveLockedRunStore, NonReplayableReason,
64    RecordedRunInfo, RecordedRunStatus, RecordedSizes, ReplayabilityStatus, ResolveRunIdResult,
65    RunStore, RunStoreSnapshot, SharedLockedRunStore, SnapshotWithReplayability, StoreRunsDir,
66    StressCompletedRunStats,
67};
68pub use summary::{
69    CoreEventKind, OutputEventKind, OutputFileName, RecordOpts, StressConditionSummary,
70    StressIndexSummary, TestEventKindSummary, TestEventSummary, ZipStoreOutput,
71};