This is a major release with several new features.
Filter expressions
Filter expressions are now ready for production. For example, to run all tests in nextest-runner and all its transitive dependencies within the workspace:
cargo nextest run -E 'deps(nextest-runner)'
This release includes a number of additions and changes to filter expressions.
Added
- The expression language supports several new predicates:
kind(name-matcher): include all tests in binary kinds (e.g.lib,test,bench) matchingname-matcher.binary(name-matcher): include all tests in binary names matchingname-matcher.platform(host)orplatform(target): include all tests that are built for the host or target platform, respectively.
Changed
-
If a filter expression is guaranteed not to match a particular binary, it will not be listed by nextest. (This allows
platform(host)andplatform(target)to work correctly.) -
If both filter expressions and standard substring filters are passed in, a test must match filter expressions AND substring filters to be executed. For example:
cargo nextest run -E 'package(nextest-runner)' test_foo test_bar
This will execute only the tests in nextest-runner that match test_foo or test_bar.
Per-test overrides
Nextest now supports per-test overrides. These overrides let you customize settings for subsets of tests. For example, to retry tests that contain the substring test_e2e 3 times:
[[profile.default.overrides]]
filter = "test(test_e2e)"
retries = 3Currently, only retries are supported. In the future, more kinds of customization will be added.
Other changes
- A new environment variable
NEXTEST_RETRIEScontrols the number of retries tests are run with. In terms of precedence, this slots in between the command-line--retriesoption and per-test overrides for retries. cargo nextest listnow hides skipped tests and binaries by default. To print out skipped tests and binaries, usecargo nextest list --verbose.- The Machine-readable output for
cargo nextest listnow contains a new"status"key. By default, this is set to"listed", and for binaries that aren't run because they don't match expression filters this is set to"skipped". - The
--platform-filteroption is deprecated, though it will keep working for all versions within the nextest 0.9 series. Use-E 'platform(host)'or-E 'platform(target)'instead. cargo nextest run -- --skipand--exactnow suggest using a filter expression instead.