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_state_dir`]: Returns the platform-specific state 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
27pub mod dicts;
28mod display;
29mod format;
30mod portable;
31mod reader;
32mod recorder;
33pub mod replay;
34mod rerun;
35mod retention;
36mod run_id_index;
37mod session;
38mod state_dir;
39mod store;
40mod summary;
41#[cfg(test)]
42mod test_helpers;
43mod tree;
44
45pub use display::{
46    DisplayPrunePlan, DisplayPruneResult, DisplayRecordedRunInfo, DisplayRecordedRunInfoDetailed,
47    DisplayRunList, RunListAlignment, Styles,
48};
49pub use format::{
50    CARGO_METADATA_JSON_PATH, OutputDict, PORTABLE_MANIFEST_FILE_NAME,
51    PortableRecordingFormatVersion, PortableRecordingVersionIncompatibility, RECORD_OPTS_JSON_PATH,
52    RERUN_INFO_JSON_PATH, RUN_LOG_FILE_NAME, RerunInfo, RerunRootInfo, RerunTestSuiteInfo,
53    RunsJsonFormatVersion, RunsJsonWritePermission, STDERR_DICT_PATH, STDOUT_DICT_PATH,
54    STORE_FORMAT_VERSION, STORE_ZIP_FILE_NAME, StoreFormatMajorVersion, StoreFormatMinorVersion,
55    StoreFormatVersion, StoreVersionIncompatibility, TEST_LIST_JSON_PATH, has_zip_extension,
56};
57pub use portable::{
58    ExtractOuterFileResult, PortableRecording, PortableRecordingEventIter, PortableRecordingResult,
59    PortableRecordingRunLog, PortableRecordingWriter, PortableStoreReader,
60};
61pub use reader::{RecordEventIter, RecordReader, StoreReader};
62pub use recorder::{RunRecorder, StoreSizes};
63pub use replay::{
64    ReplayContext, ReplayConversionError, ReplayHeader, ReplayReporter, ReplayReporterBuilder,
65};
66pub use rerun::ComputedRerunInfo;
67pub use retention::{PruneKind, PrunePlan, PruneResult, RecordRetentionPolicy};
68pub use run_id_index::{RunIdIndex, RunIdOrRecordingSelector, RunIdSelector, ShortestRunIdPrefix};
69pub use session::{
70    RecordFinalizeResult, RecordFinalizeWarning, RecordSession, RecordSessionConfig,
71    RecordSessionSetup,
72};
73pub use state_dir::{NEXTEST_STATE_DIR_ENV, encode_workspace_path, records_state_dir};
74pub use store::{
75    CompletedRunStats, ComponentSizes, ExclusiveLockedRunStore, NonReplayableReason,
76    RecordedRunInfo, RecordedRunStatus, RecordedSizes, ReplayabilityStatus, ResolveRunIdResult,
77    RunFilesExist, RunStore, RunStoreSnapshot, SharedLockedRunStore, SnapshotWithReplayability,
78    StoreRunFiles, StoreRunsDir, StressCompletedRunStats,
79};
80pub use summary::{
81    CoreEventKind, OutputEventKind, OutputFileName, RecordOpts, StressConditionSummary,
82    StressIndexSummary, TestEventKindSummary, TestEventSummary, ZipStoreOutput,
83};