Skip to content

Portable recordings

0.9.125

Recorded runs can be exported as self-contained portable recordings for sharing across machines. For example, a recording can be created in CI and downloaded locally to be replayed or used as the basis for a rerun.

Exporting a recording

To export a recording:

cargo nextest store export latest

By default, this creates a file named nextest-run-<run-id>.zip in the current directory, where <run-id> is the full UUID of the run. The output path can be customized with --archive-file:

cargo nextest store export latest --archive-file my-run.zip

Replaying and rerunning from a portable recording

To replay or rerun from a portable recording, pass the path to the .zip file as the -R argument:

# Replay a portable recording.
cargo nextest replay -R my-run.zip

# Rerun failing tests from a portable recording.
cargo nextest run -R my-run.zip

0.9.127 With Unix shells, you can also use process substitution to download a URL directly:

# Recommended: =(...) for zsh.
cargo nextest replay -R =(curl https://example.com/archive.zip)

# The <(...) syntax works in both bash and zsh, but is
# slightly less efficient.
cargo nextest replay -R <(curl https://example.com/archive.zip)

# For fish, use psub.
cargo nextest replay -R (curl https://example.com/archive.zip | psub)

GitHub workflow artifacts

If using GitHub's CI, a natural place to upload recordings is as a GitHub workflow artifact.

To download these artifacts, the gh CLI tool provides the gh run download command. This command does not currently have a way to write the recording to standard out, so process substitution can't directly be used. Instead, download the archive to disk and use that. For example:

gh run download 21978978444 -n nextest-run-ubuntu-latest-stable
cargo nextest replay nextest-run-archive.zip

Sensitive data in portable recordings

Portable recordings contain the full captured output of every test in the run. Test outputs can inadvertently contain sensitive data such as API keys, personal information (PII), or environment variable values. Nextest does not attempt to scrub or redact recordings. You are responsible for ensuring that recordings shared outside your organization do not contain sensitive information.

For more about the portable recording format, see the design document.

Options and arguments

cargo nextest store export

The output of cargo nextest store export -h:

Export a recorded run as a portable recording

Usage: cargo nextest store export [OPTIONS] [RUN_ID]

Arguments:
  [RUN_ID]  Run ID to export, or latest [aliases: -R]

Options:
      --color <WHEN>         Produce color output: auto, always, never [env:
                             CARGO_TERM_COLOR=always] [default: auto]
      --archive-file <PATH>  Destination for the archive file
      --no-pager             Do not pipe output through a pager
  -v, --verbose              Verbose output [env: NEXTEST_VERBOSE=]
  -h, --help                 Print help (see more with '--help')

Manifest options:
      --manifest-path <PATH>  Path to Cargo.toml

Config options:
      --config-file <PATH>
          Config file [default: workspace-root/.config/nextest.toml]
      --user-config-file <PATH>
          User config file [default: ~/.config/nextest/config.toml or platform equivalent] [env:
          NEXTEST_USER_CONFIG_FILE=]
      --tool-config-file <TOOL:ABS_PATH>
          Tool-specific config files
      --override-version-check
          Override checks for the minimum version defined in nextest's config
  -P, --profile <PROFILE>
          The nextest profile to use [env: NEXTEST_PROFILE=]
Export a recorded run as a portable recording

Usage: cargo nextest store export [OPTIONS] [RUN_ID]

Arguments:
  [RUN_ID]  Run ID to export, or latest [aliases: -R]

Options:
      --color <WHEN>         Produce color output: auto, always, never [env:
                             CARGO_TERM_COLOR=always] [default: auto]
      --archive-file <PATH>  Destination for the archive file
      --no-pager             Do not pipe output through a pager
  -v, --verbose              Verbose output [env: NEXTEST_VERBOSE=]
  -h, --help                 Print help (see more with '--help')

Manifest options:
      --manifest-path <PATH>  Path to Cargo.toml

Config options:
      --config-file <PATH>
          Config file [default: workspace-root/.config/nextest.toml]
      --user-config-file <PATH>
          User config file [default: ~/.config/nextest/config.toml or platform equivalent] [env:
          NEXTEST_USER_CONFIG_FILE=]
      --tool-config-file <TOOL:ABS_PATH>
          Tool-specific config files
      --override-version-check
          Override checks for the minimum version defined in nextest's config
  -P, --profile <PROFILE>
          The nextest profile to use [env: NEXTEST_PROFILE=]

The output of cargo nextest store export --help:

Export a recorded run as a portable recording

Usage: cargo nextest store export [OPTIONS] [RUN_ID]

Arguments:
  [RUN_ID]
          Run ID to export, or latest [aliases: -R].
          
          Accepts "latest" for the most recent completed run, or a full UUID or unambiguous prefix.

Options:
      --color <WHEN>
          Produce color output: auto, always, never

          [env: CARGO_TERM_COLOR=always]
          [default: auto]

      --archive-file <PATH>
          Destination for the archive file.
          
          Defaults to nextest-run-<run-id>.zip in the current directory.

      --no-pager
          Do not pipe output through a pager

  -v, --verbose
          Verbose output

          [env: NEXTEST_VERBOSE=]

  -h, --help
          Print help (see a summary with '-h')

Manifest options:
      --manifest-path <PATH>
          Path to Cargo.toml

Config options:
      --config-file <PATH>
          Config file [default: workspace-root/.config/nextest.toml]

      --user-config-file <PATH>
          User config file [default: ~/.config/nextest/config.toml or platform equivalent].
          
          User configuration stores per-user preferences like UI settings. Use "none" to skip
          loading user config entirely.

          [env: NEXTEST_USER_CONFIG_FILE=]

      --tool-config-file <TOOL:ABS_PATH>
          Tool-specific config files.
          
          Some tools on top of nextest may want to set up their own default configuration but
          prioritize user configuration on top. Use this argument to insert configuration that's
          lower than --config-file in priority but above the default config shipped with nextest.
          
          Arguments are specified in the format "tool:abs_path", for example
          "my-tool:/path/to/nextest.toml" (or "my-tool:C:\path\to\nextest.toml" on Windows). Paths
          must be absolute.
          
          This argument may be specified multiple times. Files that come later are lower priority
          than those that come earlier.

      --override-version-check
          Override checks for the minimum version defined in nextest's config.
          
          Repository and tool-specific configuration files can specify minimum required and
          recommended versions of nextest. This option overrides those checks.

  -P, --profile <PROFILE>
          The nextest profile to use.
          
          Nextest's configuration supports multiple profiles, which can be used to set up different
          configurations for different purposes. (For example, a configuration for local runs and
          one for CI.) This option selects the profile to use.

          [env: NEXTEST_PROFILE=]
Export a recorded run as a portable recording

Usage: cargo nextest store export [OPTIONS] [RUN_ID]

Arguments:
  [RUN_ID]
          Run ID to export, or latest [aliases: -R].

          Accepts "latest" for the most recent completed run, or a full UUID or unambiguous prefix.

Options:
      --color <WHEN>
          Produce color output: auto, always, never

          [env: CARGO_TERM_COLOR=always]
          [default: auto]

      --archive-file <PATH>
          Destination for the archive file.

          Defaults to nextest-run-<run-id>.zip in the current directory.

      --no-pager
          Do not pipe output through a pager

  -v, --verbose
          Verbose output

          [env: NEXTEST_VERBOSE=]

  -h, --help
          Print help (see a summary with '-h')

Manifest options:
      --manifest-path <PATH>
          Path to Cargo.toml

Config options:
      --config-file <PATH>
          Config file [default: workspace-root/.config/nextest.toml]

      --user-config-file <PATH>
          User config file [default: ~/.config/nextest/config.toml or platform equivalent].

          User configuration stores per-user preferences like UI settings. Use "none" to skip
          loading user config entirely.

          [env: NEXTEST_USER_CONFIG_FILE=]

      --tool-config-file <TOOL:ABS_PATH>
          Tool-specific config files.

          Some tools on top of nextest may want to set up their own default configuration but
          prioritize user configuration on top. Use this argument to insert configuration that's
          lower than --config-file in priority but above the default config shipped with nextest.

          Arguments are specified in the format "tool:abs_path", for example
          "my-tool:/path/to/nextest.toml" (or "my-tool:C:\path\to\nextest.toml" on Windows). Paths
          must be absolute.

          This argument may be specified multiple times. Files that come later are lower priority
          than those that come earlier.

      --override-version-check
          Override checks for the minimum version defined in nextest's config.

          Repository and tool-specific configuration files can specify minimum required and
          recommended versions of nextest. This option overrides those checks.

  -P, --profile <PROFILE>
          The nextest profile to use.

          Nextest's configuration supports multiple profiles, which can be used to set up different
          configurations for different purposes. (For example, a configuration for local runs and
          one for CI.) This option selects the profile to use.

          [env: NEXTEST_PROFILE=]