Module record

Module record 

Source
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§

CompletedRunStats
Statistics for a normal test run that finished (completed or cancelled).
ComponentSizes
Compressed and uncompressed sizes for a single component.
ComputedRerunInfo
Result of computing outstanding and passing tests from a recorded run.
DisplayPrunePlan
A display wrapper for PrunePlan.
DisplayPruneResult
A display wrapper for PruneResult.
DisplayRecordedRunInfo
A display wrapper for RecordedRunInfo.
DisplayRecordedRunInfoDetailed
A detailed display wrapper for RecordedRunInfo.
DisplayRunList
A display wrapper for a list of recorded runs.
ExclusiveLockedRunStore
A run store that has been locked for exclusive access.
ExtractOuterFileResult
Result of extracting a file from a portable recording.
OutputFileName
A validated output file name in the zip archive.
PortableRecording
A portable recording opened for reading.
PortableRecordingEventIter
Iterator over events from a portable recording’s run log.
PortableRecordingFormatVersion
Combined major and minor version of the portable recording format.
PortableRecordingResult
Result of writing a portable recording.
PortableRecordingRunLog
The run log from a portable recording, read into memory.
PortableRecordingWriter
Writer to create a portable recording from a recorded run.
PortableStoreReader
Reader for the inner store.zip within a portable recording.
PrunePlan
The result of computing a prune plan (dry-run mode).
PruneResult
The result of a pruning operation.
RecordEventIter
Iterator over recorded events.
RecordFinalizeResult
Result of finalizing a recording session.
RecordOpts
Options that affect how test results are interpreted during replay.
RecordReader
Reader for a recorded test run.
RecordRetentionPolicy
A retention policy for recorded test runs.
RecordSession
Manages the full lifecycle of a recording session.
RecordSessionConfig
Configuration for creating a recording session.
RecordSessionSetup
Result of setting up a recording session.
RecordedRunInfo
Information about a recorded run.
RecordedSizes
Sizes broken down by component (log and store).
RerunInfo
Rerun-specific metadata stored in meta/rerun-info.json.
RerunRootInfo
For a rerun, information obtained from the root of the rerun chain.
RerunTestSuiteInfo
A test suite’s outstanding and passing test cases.
ResolveRunIdResult
Result of looking up a run by selector.
RunIdIndex
An index of run IDs enabling efficient prefix lookup and shortest unique prefix computation.
RunListAlignment
Alignment information for displaying a list of runs.
RunRecorder
Records a single test run to disk.
RunStore
Manages the storage of recorded test runs.
RunStoreSnapshot
A snapshot of run store data.
RunsJsonFormatVersion
Version of the runs.json.zst outer format.
SharedLockedRunStore
A run store that has been locked for shared (read-only) access.
ShortestRunIdPrefix
The shortest unique prefix for a run ID, split into the unique prefix and remaining portion.
SnapshotWithReplayability
A snapshot paired with precomputed replayability status for all runs.
StoreFormatMajorVersion
Major version of the store.zip archive format for breaking changes to the archive structure.
StoreFormatMinorVersion
Minor version of the store.zip archive format for additive changes.
StoreFormatVersion
Combined major and minor version of the store.zip archive format.
StoreRunFiles
Checks file existence for a run stored on disk.
StoreRunsDir
A reference to the runs directory in a run store.
StoreSizes
Compressed and uncompressed sizes for storage, broken down by component.
StressCompletedRunStats
Statistics for a stress test run that finished (completed or cancelled).
StressIndexSummary
Serializable version of StressIndex.
Styles
Styles for displaying record store information.
TestEventSummary
A serializable form of a test event.

Enums§

CoreEventKind
Events that don’t carry test output.
NonReplayableReason
A definite reason why a run cannot be replayed.
OutputDict
Which dictionary to use for compressing/decompressing a file.
OutputEventKind
Events that carry test output.
PortableRecordingVersionIncompatibility
An incompatibility between an archive’s portable format version and what the reader supports.
PruneKind
Whether pruning was explicit (user-requested) or implicit (automatic).
RecordFinalizeWarning
Non-fatal warning during recording finalization.
RecordedRunStatus
Status and statistics for a recorded run.
ReplayabilityStatus
The result of checking whether a run can be replayed.
RunIdOrRecordingSelector
Selector that can be either a run ID (for store lookup) or a recording path.
RunIdSelector
Selector for identifying a run, either the most recent or by prefix.
RunsJsonWritePermission
Whether a runs.json.zst file can be written to.
StoreVersionIncompatibility
An incompatibility between an archive’s store format version and what the reader supports.
StressConditionSummary
Serializable version of StressCondition.
TestEventKindSummary
The kind of test event.
ZipStoreOutput
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§

RunFilesExist
Trait for checking whether required run files exist.
StoreReader
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 .zip extension (case-insensitive).
records_state_dir
Returns the platform-specific state directory for nextest records for a workspace.