From 491652837fbf9f8a5e04db75bd8225edfc8386a4 Mon Sep 17 00:00:00 2001 From: Rain Date: Wed, 20 Sep 2023 15:23:00 -0700 Subject: [PATCH] [meta] prepare release --- site/src/CHANGELOG.md | 12 +++++- site/src/SUMMARY.md | 1 + site/src/book/per-test-overrides.md | 7 ++-- site/src/book/specifying-platforms.md | 56 +++++++++++++++++++++++++++ site/src/book/target-runners.md | 2 + 5 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 site/src/book/specifying-platforms.md diff --git a/site/src/CHANGELOG.md b/site/src/CHANGELOG.md index cee233fc9fa..435d799c411 100644 --- a/site/src/CHANGELOG.md +++ b/site/src/CHANGELOG.md @@ -3,9 +3,16 @@ This page documents new features and bugfixes for cargo-nextest. Please see the [stability policy](book/stability.md) for how versioning works with cargo-nextest. -## [0.9.58-rc.3] - 2023-09-20 +## [0.9.58] - 2023-09-20 -This is a test release. +### Added + +- Per-test overrides [can now be filtered separately](https://nexte.st/book/per-test-overrides#specifying-platforms) by host and target platforms. +- New `--cargo-quiet` and `--cargo-verbose` options to control Cargo's quiet and verbose output options. Thanks [Oliver Tale-Yazdi](https://github.com/ggwpez) for your first contribution! + +### Fixed + +- Improved color support by pulling in [zkat/supports-color#14](https://github.com/zkat/supports-color/pull/14). Now nextest should produce color more often when invoked over SSH. ## [0.9.57] - 2023-08-02 @@ -790,6 +797,7 @@ Supported in this initial release: * [Test retries](book/retries.md) and flaky test detection * [JUnit support](book/junit.md) for integration with other test tooling +[0.9.58]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.58 [0.9.57]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.57 [0.9.56]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.56 [0.9.55]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.55 diff --git a/site/src/SUMMARY.md b/site/src/SUMMARY.md index 7065537051b..553d840794d 100644 --- a/site/src/SUMMARY.md +++ b/site/src/SUMMARY.md @@ -26,6 +26,7 @@ - [Environment variables](book/env-vars.md) - [Minimum nextest versions](book/minimum-versions.md) - [Per-test overrides](book/per-test-overrides.md) + - [Specifying platforms](book/specifying-platforms.md) - [Heavy tests and threads-required](book/threads-required.md) - [Test groups and mutual exclusion](book/test-groups.md) - [JUnit support](book/junit.md) diff --git a/site/src/book/per-test-overrides.md b/site/src/book/per-test-overrides.md index ef2b1d68ee8..3d4de5be31d 100644 --- a/site/src/book/per-test-overrides.md +++ b/site/src/book/per-test-overrides.md @@ -4,9 +4,8 @@ Nextest supports overriding some settings for subsets of tests, using the [filte Overrides are set via the `[[profile..overrides]]` list. Each override consists of the following: * `filter` — The filter expression to match. -* `platform` — The Rust [target triple](https://doc.rust-lang.org/beta/rustc/platform-support.html#platform-support) or [`cfg()` expression](https://doc.rust-lang.org/reference/conditional-compilation.html) to match. +* `platform` — The [platforms](specifying-platforms.md) to match. * Supported overrides, which are optional. Currently supported are: - * `retries` — Number of retries to run tests with. * `threads-required` — Number of [threads required](threads-required.md) for this test. * `test-group` — An optional [test group](test-groups.md) for this test. * `slow-timeout` — Amount of time after which [tests are marked slow](slow-tests.md). @@ -34,7 +33,7 @@ slow-timeout = "5m" [[profile.ci.overrides]] filter = 'test(/\btest_filesystem_/)' -platform = 'cfg(target_os = "macos")' +platform = { host = 'cfg(target_os = "macos")' } leak-timeout = "500ms" success-output = "immediate" ``` @@ -42,7 +41,7 @@ success-output = "immediate" When `--profile ci` is specified: * for test names that start with `test_network_` (including test names like `my_module::test_network_`), retry tests up to 4 times * on `x86_64-unknown-linux-gnu`, set a slow timeout of 5 minutes -* on macOS, for test names that start with `test_filesystem_` (including test names like `my_module::test_filesystem_`), set a leak timeout of 500 milliseconds, and show success output immediately. +* on macOS hosts, for test names that start with `test_filesystem_` (including test names like `my_module::test_filesystem_`), set a leak timeout of 500 milliseconds, and show success output immediately. ## Override precedence diff --git a/site/src/book/specifying-platforms.md b/site/src/book/specifying-platforms.md new file mode 100644 index 00000000000..dfd12c14939 --- /dev/null +++ b/site/src/book/specifying-platforms.md @@ -0,0 +1,56 @@ +# Specifying platforms for per-test overrides + +[Per-test overrides](per-test-overrides.md) support filtering by platform. Either a Rust [target triple](https://doc.rust-lang.org/beta/rustc/platform-support.html#platform-support) or [`cfg()` expression](https://doc.rust-lang.org/reference/conditional-compilation.html) may be specified. + +For example, with the following configuration: + +```toml +[[profile.default.overrides]] +platform = 'cfg(target_os = "linux")' +retries = 3 +``` + +Test runs on Linux will have 3 retries. + +## Cross-compiling + +While cross-compiling code, nextest's per-test overrides support filtering by either *host* or *target* platforms. + +If `platform` is set to a string, then nextest will consider it to be the *target* filter. For example, if the following is specified: + +```toml +[[profile.default.overrides]] +platform = 'aarch64-apple-darwin' +slow-timeout = "120s" +``` + +Then test runs performed either natively on `aarch64-apple-darwin`, or while cross-compiling from some other operating system to `aarch64-apple-darwin`, will be marked slow after 120 seconds. + +Starting nextest version 0.9.58, `platform` can also be set to a map with `host` and `target` keys. While determining whether a particular override applies, nextest will apply both host and target filters (AND operation). + +For example: + +```toml +[[profile.default.overrides]] +platform = { host = 'cfg(target_os = "macos")' } +retries = 1 + +[[profile.default.overrides]] +platform = { host = 'x86_64-unknown-linux-gnu', target = 'cfg(windows)' } +threads-required = 2 +``` + +With this configuration: + +* On macOS hosts (regardless of the target platform), tests will be retried once. +* On x86_64 Linux hosts, while cross-compiling to Windows, tests will be marked as requiring two threads each. + +> **Note:** Specifying `platform` as a string is equivalent to specifying it as a map with the `target` key. + +## Host tests + +While cross-compiling code, some tests may need to be run on the host platform. (See the note about [Filtering by build platform](running.md#filtering-by-build-platform) for more.) + +For tests that run on the host platform, to figure out if an override applies nextest will compute the result of the *target* filter against the *host* platform. (If the `host` key is specified, it will be considered as well based on the AND semantics listed above.) + +This behavior is similar to that of [target runners](target-runners.md#cross-compiling). diff --git a/site/src/book/target-runners.md b/site/src/book/target-runners.md index 7235bcd4c63..76aa33eb83f 100644 --- a/site/src/book/target-runners.md +++ b/site/src/book/target-runners.md @@ -36,6 +36,8 @@ While cross-compiling code, some tests may need to be run on the host platform. For tests that run on the host platform, nextest uses the target runner defined for the host. For example, if cross-compiling from `x86_64-unknown-linux-gnu` to `x86_64-pc-windows-msvc`, nextest will use the `CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER` for proc-macro and other host-only tests, and `CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUNNER` for other tests. +This behavior is similar to that of [per-test overrides](specifying-platforms.md#host-tests). + ## Debugging output Nextest invokes target runners during both the list and run phases. During the list phase, nextest has [stringent rules] for the contents of standard output.