版本发布 8
### Added - Following up from the recently-added schema for repository configuration, nextest now also provides a [JSON Schema](https://nexte.st/docs/user-config/reference#user-configuration-schema) for [user configuration](https://nexte.st/docs/user-config/). The schema for the running version can be obtained by running `cargo nextest self schema user-config`. ([#3351]) ### Changed - The `max-progress-running` user-config setting no longer accepts numeric strings like `"8"` (an undocumented fallback). The supported values remain a non-negative integer (e.g. `8`) or `"infinite"`. ([#3350]) [#3350]: https://github.com/nextest-rs/nextest/pull/3350 [#3351]: https://github.com/nextest-rs/nextest/pull/3351
### Added - [Setup scripts](https://nexte.st/docs/configuration/setup-scripts/) and [wrapper scripts](https://nexte.st/docs/configuration/wrapper-scripts/) can now specify per-command environment variables via the `env` field in the command configuration. ([#3001]) For example: ```toml [scripts.setup.script1] command = { command-line = "cargo run -p setup-test-db", env = { DB_PATH = "sqlite:/path/to/source.db", }, } ``` Keys cannot begin with `NEXTEST`, as that prefix is reserved for internal use. Values defined in `env` override values set by the environment and by Cargo's `config.toml` (including those with `force = true`). Thanks [metatoaster](https://github.com/metatoaster) for your first contribution! - A new `flaky-result` configuration field and `--flaky-result` CLI flag (environment variable `NEXTEST_FLAKY_RESULT`) that controls whether flaky tests are treated as passing or failing. When set to `"fail"`, tests that pass on retry are marked as failures. The default remains `"pass"`. `flaky-result` can be set at the profile level or per-test via overrides. ([#3148]) For more information, see [_Failing flaky tests_](https://nexte.st/docs/features/retries/#failing-flaky-tests). ```toml [profile.ci] retries = 2 flaky-result = "fail" ``` - A new `cargo nextest store export-chrome-trace` command that exports test run data in the [Chrome Trace Event format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview). Traces can be loaded into [Perfetto](https://ui.perfetto.dev/) or Chrome's `chrome://tracing` for a timeline view of test parallelism and execution. ([#3163]) ```bash cargo nextest store export-chrome-trace latest -o trace.json ``` Traces support grouping by binary (default) or by slot (`--group-by slot`), and can be exported from both on-disk runs and [portable recordings](https://nexte.st/docs/features/record-replay-rerun/portable-recordings/). For more, see [_Perfetto traces_](https://nexte.st/docs/features/record-replay-rerun/perfetto-chrome-traces/). ### Fixed - Nextest now works with the new build directory layout ([`-Zbuild-dir-new-layout`](https://blog.rust-lang.org/2026/03/13/call-for-testing-build-dir-layout-v2/)), and with the build directory being separate from the target directory ([`build.build-dir`](https://doc.rust-lang.org/cargo/reference/config.html#buildbuild-dir)). ([#3168], [#3169]) ### Miscellaneous - Self-update (`cargo nextest self update`) now uses ureq instead of reqwest and replaces the `ring` dependency with `aws-lc-rs`. This may require you to install CMake if you're on a less-commonly-used platform. ([#3141]) ### Internal improvements - Breaking change to the [recording format](https://nexte.st/docs/features/record-replay-rerun/): recordings now include test group and slot information, enabling Chrome trace export from recordings. ([#3158]) [#3001]: https://github.com/nextest-rs/nextest/pull/3001 [#3141]: https://github.com/nextest-rs/nextest/pull/3141 [#3148]: https://github.com/nextest-rs/nextest/pull/3148 [#3158]: https://github.com/nextest-rs/nextest/pull/3158 [#3163]: https://github.com/nextest-rs/nextest/pull/3163 [#3168]: https://github.com/nextest-rs/nextest/pull/3168 [#3169]: https://github.com/nextest-rs/nextest/pull/3169
### Changed - `--show-progress=only` now behaves like the default `auto` in non-interactive mode, showing successful tests with a counter. This change was made because `only` is primarily intended for interactive scenarios. ([#3087]) - The MSRV for building nextest has been updated to Rust 1.91. ### Fixed - [Setup scripts](https://nexte.st/docs/configuration/setup-scripts/) that write `NEXTEST`-prefixed environment variables to `$NEXTEST_ENV` now properly report failure. Previously, the setup script would be reported as successful despite invalid variables, and tests would still run. ([#3094]) ### Internal improvements - [Replay output](https://nexte.st/docs/features/record-replay-rerun/) is now only loaded from the archive when needed. This makes replays around 10-15% faster. ([#3090]) - Switched from the `zip` crate to `eazip` to address repeated semver breakage in the `zip` crate. ([#3093]) [#3087]: https://github.com/nextest-rs/nextest/pull/3087 [#3090]: https://github.com/nextest-rs/nextest/pull/3090 [#3093]: https://github.com/nextest-rs/nextest/pull/3093 [#3094]: https://github.com/nextest-rs/nextest/pull/3094
### Changed - Recorded test runs are now stored in the system **state directory** rather than the cache directory, since they are not regenerable. ([#3043]) | Platform | New location | |----------|--------------| | Linux, macOS, and other Unix | `$XDG_STATE_HOME/nextest/` or `~/.local/state/nextest/` | | Windows | `%LOCALAPPDATA%\nextest\` (unchanged) | The store location can now be overridden via `NEXTEST_STATE_DIR` (previously `NEXTEST_CACHE_DIR`). For this release, records in the cache directory will be automatically migrated on the next nextest run. Since this feature is experimental, the migration path will be removed soon (in the next 1-2 releases). [#3043]: https://github.com/nextest-rs/nextest/pull/3043
### Fixed The unsupported install mechanism, `cargo install cargo-nextest` without `--locked`, now fails with a helpful error message asking you to use `cargo install --locked cargo-nextest`. Note that this unsupported method was broken with version 0.9.123 due to a dependency update, resulting in several issues being filed. We hope that the new mechanism results in clearer, more helpful guidance.
### Added - `MismatchReason::ALL_VARIANTS` iterates over all known variants of `MismatchReason`.