Skip to content

Commit

Permalink
[meta] prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshowers committed Sep 20, 2023
1 parent 28c7fa9 commit 4916528
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 6 deletions.
12 changes: 10 additions & 2 deletions site/src/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions site/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions site/src/book/per-test-overrides.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ Nextest supports overriding some settings for subsets of tests, using the [filte

Overrides are set via the `[[profile.<name>.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).
Expand Down Expand Up @@ -34,15 +33,15 @@ 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"
```

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

Expand Down
56 changes: 56 additions & 0 deletions site/src/book/specifying-platforms.md
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 2 additions & 0 deletions site/src/book/target-runners.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4916528

Please sign in to comment.