Record, replay and rerun¶
Experimental: This feature is not yet stable
- Enable with: Add
[experimental]withrecord = trueto~/.config/nextest/config.toml, or setNEXTEST_EXPERIMENTAL_RECORD=1in the environment - Tracking issue: TBD
Nextest supports recording test runs to rerun failing tests and to replay them later. Recorded runs are stored locally in the system cache.
Recorded test runs capture:
- Test statuses (pass, fail, etc) and durations.
- Outputs for all tests, both failing and successful. (If
--no-captureis passed in at the time the run is recorded, test output cannot be captured.)
Use cases¶
- Rerunning tests that failed or were not run in the past, with the goal being to iteratively converge towards a successful test run.
- Replaying test runs, including those that might have aged past terminal scrollback.
In the future, it will be possible to export replayed test runs in various formats such as JUnit and libtest-json output.
Usage¶
To enable recording in user configuration:
Enabling recording in
~/.config/nextest/config.toml[experimental]
record = true
[record]
enabled = true
Now, all future cargo nextest run instances will automatically be recorded.
Learn more¶
- Rerunning failed tests — iteratively converge towards a successful test run.
- Replaying test runs — replay recorded runs, including with different reporter options.
- Portable recordings — export and share recordings across machines.
- Managing recorded runs — list, prune, and configure the record store.
Configuration options¶
For a full list, see Record configuration.