Skip to content

Commit

Permalink
[meta] prepare releases
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshowers committed Dec 12, 2024
1 parent 4e6c61c commit be15689
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
11 changes: 11 additions & 0 deletions fixtures/setup-script-junit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<testsuite name="@setup-script:build-seed-archive" tests="1" disabled="0" errors="0" failures="0">
<properties>
<property name="command" value="cargo"/>
<property name="args" value="run --bin build-seed-archive"/>
<property name="output-env:SEED_ARCHIVE" value="/tmp/nextest-tests-seed-runner/seed-4a73a58.tar.zst"/>
</properties>
<testcase name="build-seed-archive" classname="@setup-script:build-seed-archive" timestamp="2024-12-11T22:59:50.824+00:00" time="2.265">
<system-out>using existing seed: /tmp/nextest-tests-seed-runner/seed-4a73a58.tar.zst</system-out>
<system-err>(stderr not captured)</system-err>
</testcase>
</testsuite>
7 changes: 6 additions & 1 deletion nextest-runner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## [0.69.0-b.3] - 2024-12-06
## [0.69.0-b.4] - 2024-12-11

See the changelog for [cargo-nextest 0.9.86-b.4](https://nexte.st/changelog#0.9.86-b.4).

## [0.69.0-b.3] - 2024-12-09

See the changelog for [cargo-nextest 0.9.86-b.3](https://nexte.st/changelog#0.9.86-b.3).

Expand Down Expand Up @@ -510,6 +514,7 @@ Thanks to [Guiguiprim](https://github.com/Guiguiprim) for their contributions to

- Initial version.

[0.69.0-b.4]: https://github.com/nextest-rs/nextest/releases/tag/nextest-runner-0.69-0.b.4
[0.69.0-b.3]: https://github.com/nextest-rs/nextest/releases/tag/nextest-runner-0.69-0.b.3
[0.69.0-b.2]: https://github.com/nextest-rs/nextest/releases/tag/nextest-runner-0.69-0.b.2
[0.69.0-b.1]: https://github.com/nextest-rs/nextest/releases/tag/nextest-runner-0.69-0.b.1
Expand Down
28 changes: 28 additions & 0 deletions site/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,33 @@ toc_depth: 1
This page documents new features and bugfixes for cargo-nextest. Please see the [stability
policy](https://nexte.st/docs/stability/) for how versioning works with cargo-nextest.

## [0.9.86-b.4] - 2024-12-11

Since beta 3:

### Added

- Setup scripts are now represented in the JUnit output. For more information,
see [*Setup scripts in JUnit output*].

### Changed

- Each test now has a separate Tokio task associated with it. This leads to
greater reliability (each test's task can now panic independently), and is
faster in repos with many small tests.

For example, in one test done against
[`clap-rs/clap`](https://github.com/clap-rs/clap) on Linux, `cargo nextest
run` goes down from 0.36 seconds to 0.23 seconds.

### Fixed

- Fixed a bug where pressing two Ctrl-Cs in succession would not `SIGKILL` any running tests.
- `junit.store-success-output` now works correctly -- previously, storage of output is disabled unconditionally.
- In JUnit output, the `testsuite` elements are now stored in the order they are first seen (`IndexMap`), rather than in random order (`HashMap`).

[*Setup scripts in JUnit output*]: https://nexte.st/docs/configuration/setup-scripts/#setup-scripts-in-junit-output

## [0.9.86-b.3] - 2024-12-09

Since beta 2:
Expand Down Expand Up @@ -1276,6 +1303,7 @@ Supported in this initial release:
- [Test retries](https://nexte.st/book/retries.md) and flaky test detection
- [JUnit support](https://nexte.st/book/junit.md) for integration with other test tooling

[0.9.86-b.4]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.86-b.4
[0.9.86-b.3]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.86-b.3
[0.9.86-b.2]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.86-b.2
[0.9.86-b.1]: https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-0.9.86-b.1
Expand Down
48 changes: 48 additions & 0 deletions site/src/docs/configuration/setup-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,51 @@ fn my_env_test() {
assert_eq!(std::env::var("MY_ENV_VAR"), Ok("Hello, world!".to_string()));
}
```

## Setup scripts in JUnit output

<!-- md:version 0.9.86 -->

If nextest's [JUnit support](../machine-readable/junit.md) is enabled, information
about setup scripts is included in the JUnit output.

JUnit doesn't have native support for setup scripts, so nextest represents them as
individual tests:

- Each setup script is represented as a separate `<testsuite>` element, with the
`name` property set to `@setup-script:[script-name]`. Each test suite has a single
`<testcase>` element, with the `name` property set to the script's name.
- As a result, setup script adds 1 to the number of tests in the root `<testsuites>`
element.
- A failure or timeout in the script is represented as a `<failure>` element.
- An execution error to start the script is represented as an `<error>` element.
- In the `<testsuite>` element's `<properties>` section, the following properties
are added:
- `command`: The command that was executed.
- `args`: The arguments that were passed to the command, concatenated via Unix shell rules.
- For each environment variable set by the script, a property is added with the
name `output-env:[env-name]`, and the value the environment variable's value.

### Standard output and standard error

If captured, the script's standard output and standard error are included as
`<system-out>` and `<system-err>` elements, respectively. Unlike with tests,
where by default output is only included if the test failed, with scripts they
are always included by default. To alter this behavior, use the
`junit.store-success-output` and/or `junit.store-failure-output` configuration
settings:

```toml title="Configuration to control JUnit output for setup scripts"
[script.my-script]
command = 'my-script.sh'
junit.store-success-output = false
junit.store-failure-output = true
```

### Example: JUnit output

Here's an example of a `testsuite` element corresponding to a setup script:

```bash exec="true" result="xml"
cat ../fixtures/setup-script-junit.xml
```

0 comments on commit be15689

Please sign in to comment.