Expand description
Recording infrastructure for nextest runs.
This module provides functionality to record test runs to disk for later inspection and replay. The recording captures test events, outputs, and metadata in a structured archive format.
§Architecture
The recording system consists of:
RunStore: Manages the directory where recordings are stored, handling locking and the list of recorded runs.RunRecorder: Writes a single run’s data to disk, including metadata and events.RecordReader: Reads a recorded run from disk for replay or inspection.records_state_dir: Returns the platform-specific state directory for recordings.
§Archive format
Each run is stored in a directory named by its UUID, containing:
store.zip: A zstd-compressed archive containing metadata and test outputs.run.log.zst: A zstd-compressed JSON Lines file of test events.
Re-exports§
pub use replay::ReplayContext;pub use replay::ReplayConversionError;pub use replay::ReplayHeader;pub use replay::ReplayReporter;pub use replay::ReplayReporterBuilder;
Modules§
- dicts
- Pre-trained zstd dictionaries for compressing test output.
- replay
- Replay infrastructure for recorded test runs.
Structs§
- Completed
RunStats - Statistics for a normal test run that finished (completed or cancelled).
- Component
Sizes - Compressed and uncompressed sizes for a single component.
- Computed
Rerun Info - Result of computing outstanding and passing tests from a recorded run.
- Display
Prune Plan - A display wrapper for
PrunePlan. - Display
Prune Result - A display wrapper for
PruneResult. - Display
Recorded RunInfo - A display wrapper for
RecordedRunInfo. - Display
Recorded RunInfo Detailed - A detailed display wrapper for
RecordedRunInfo. - Display
RunList - A display wrapper for a list of recorded runs.
- Exclusive
Locked RunStore - A run store that has been locked for exclusive access.
- Extract
Outer File Result - Result of extracting a file from a portable recording.
- Output
File Name - A validated output file name in the zip archive.
- Portable
Recording - A portable recording opened for reading.
- Portable
Recording Event Iter - Iterator over events from a portable recording’s run log.
- Portable
Recording Format Version - Combined major and minor version of the portable recording format.
- Portable
Recording Result - Result of writing a portable recording.
- Portable
Recording RunLog - The run log from a portable recording, read into memory.
- Portable
Recording Writer - Writer to create a portable recording from a recorded run.
- Portable
Store Reader - Reader for the inner store.zip within a portable recording.
- Prune
Plan - The result of computing a prune plan (dry-run mode).
- Prune
Result - The result of a pruning operation.
- Record
Event Iter - Iterator over recorded events.
- Record
Finalize Result - Result of finalizing a recording session.
- Record
Opts - Options that affect how test results are interpreted during replay.
- Record
Reader - Reader for a recorded test run.
- Record
Retention Policy - A retention policy for recorded test runs.
- Record
Session - Manages the full lifecycle of a recording session.
- Record
Session Config - Configuration for creating a recording session.
- Record
Session Setup - Result of setting up a recording session.
- Recorded
RunInfo - Information about a recorded run.
- Recorded
Sizes - Sizes broken down by component (log and store).
- Rerun
Info - Rerun-specific metadata stored in
meta/rerun-info.json. - Rerun
Root Info - For a rerun, information obtained from the root of the rerun chain.
- Rerun
Test Suite Info - A test suite’s outstanding and passing test cases.
- Resolve
RunId Result - Result of looking up a run by selector.
- RunId
Index - An index of run IDs enabling efficient prefix lookup and shortest unique prefix computation.
- RunList
Alignment - Alignment information for displaying a list of runs.
- RunRecorder
- Records a single test run to disk.
- RunStore
- Manages the storage of recorded test runs.
- RunStore
Snapshot - A snapshot of run store data.
- Runs
Json Format Version - Version of the
runs.json.zstouter format. - Shared
Locked RunStore - A run store that has been locked for shared (read-only) access.
- Shortest
RunId Prefix - The shortest unique prefix for a run ID, split into the unique prefix and remaining portion.
- Snapshot
With Replayability - A snapshot paired with precomputed replayability status for all runs.
- Store
Format Major Version - Major version of the
store.ziparchive format for breaking changes to the archive structure. - Store
Format Minor Version - Minor version of the
store.ziparchive format for additive changes. - Store
Format Version - Combined major and minor version of the
store.ziparchive format. - Store
RunFiles - Checks file existence for a run stored on disk.
- Store
Runs Dir - A reference to the runs directory in a run store.
- Store
Sizes - Compressed and uncompressed sizes for storage, broken down by component.
- Stress
Completed RunStats - Statistics for a stress test run that finished (completed or cancelled).
- Stress
Index Summary - Serializable version of
StressIndex. - Styles
- Styles for displaying record store information.
- Test
Event Summary - A serializable form of a test event.
Enums§
- Core
Event Kind - Events that don’t carry test output.
- NonReplayable
Reason - A definite reason why a run cannot be replayed.
- Output
Dict - Which dictionary to use for compressing/decompressing a file.
- Output
Event Kind - Events that carry test output.
- Portable
Recording Version Incompatibility - An incompatibility between an archive’s portable format version and what the reader supports.
- Prune
Kind - Whether pruning was explicit (user-requested) or implicit (automatic).
- Record
Finalize Warning - Non-fatal warning during recording finalization.
- Recorded
RunStatus - Status and statistics for a recorded run.
- Replayability
Status - The result of checking whether a run can be replayed.
- RunId
OrRecording Selector - Selector that can be either a run ID (for store lookup) or a recording path.
- RunId
Selector - Selector for identifying a run, either the most recent or by prefix.
- Runs
Json Write Permission - Whether a runs.json.zst file can be written to.
- Store
Version Incompatibility - An incompatibility between an archive’s store format version and what the reader supports.
- Stress
Condition Summary - Serializable version of
StressCondition. - Test
Event Kind Summary - The kind of test event.
- ZipStore
Output - Output stored as a reference to a file in the zip archive.
Constants§
- NEXTEST_
STATE_ DIR_ ENV - Environment variable to override the nextest state directory.
- STORE_
FORMAT_ VERSION - The current format version for recorded test runs (store.zip and run.log).
Statics§
- CARGO_
METADATA_ JSON_ PATH - Path to cargo metadata within the store archive.
- PORTABLE_
MANIFEST_ FILE_ NAME - File name for the manifest within a portable recording.
- RECORD_
OPTS_ JSON_ PATH - Path to record options within the store archive.
- RERUN_
INFO_ JSON_ PATH - Path to rerun info within the store archive (only present for reruns).
- RUN_
LOG_ FILE_ NAME - File name for the run log.
- STDERR_
DICT_ PATH - Path to the stderr dictionary within the store archive.
- STDOUT_
DICT_ PATH - Path to the stdout dictionary within the store archive.
- STORE_
ZIP_ FILE_ NAME - File name for the store archive.
- TEST_
LIST_ JSON_ PATH - Path to the test list within the store archive.
Traits§
- RunFiles
Exist - Trait for checking whether required run files exist.
- Store
Reader - Trait for reading from a recorded run’s store.
Functions§
- encode_
workspace_ path - Encodes a workspace path into a directory-safe string.
- has_
zip_ extension - Returns true if the path has a
.zipextension (case-insensitive). - records_
state_ dir - Returns the platform-specific state directory for nextest records for a workspace.