Skip to content

Commit e13b0f8

Browse files
committed
[site] update with skip and exact info
Also change remaining uses of "default set" to "default filter".
1 parent f3fac6d commit e13b0f8

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

site/src/docs/running.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The default filter is available in the filterset DSL via the `default()` predica
9393

9494
By default, command-line arguments are always interpreted with respect to the default filter. For example, `cargo nextest -E 'all()'` will run all tests that match the default filter.
9595

96-
To override the default set on the command line, use `--ignore-default-filter`. For example, `cargo nextest -E 'all()' --ignore-default-filter` will run all tests, including those not in the default set.
96+
To override the default filter on the command line, use `--ignore-default-filter`. For example, `cargo nextest -E 'all()' --ignore-default-filter` will run all tests, including those not in the default filter.
9797

9898
Because skipping some tests can be surprising, nextest prints the number of tests and binaries
9999
skipped due to their presence in the default filter. For example:
@@ -110,40 +110,49 @@ skipped due to their presence in the default filter. For example:
110110
cat src/outputs/default-filter-output.ansi | ../scripts/strip-ansi.sh
111111
```
112112

113-
!!! tip "Default set vs ignored tests"
113+
!!! tip "Default filter vs ignored tests"
114114

115-
The default set and `#[ignore]` can both be used to filter out some tests by default. However, there are key distinctions between the two:
115+
The default filter and `#[ignore]` can both be used to filter out some tests by default. However, there are key distinctions between the two:
116116

117-
1. The default set is defined in nextest's configuration while ignored tests are annotated within Rust code.
118-
2. Default sets can be separately configured per-profile. Ignored tests cannot.
119-
3. Default sets are a nextest feature, while ignored tests also work with `cargo test`.
117+
1. The default filter is defined in nextest's configuration while ignored tests are annotated within Rust code.
118+
2. Default filters can be separately configured per-profile. Ignored tests are global to the repository.
119+
3. Default filters are a nextest feature, while ignored tests also work with `cargo test`.
120120

121-
In practice, `#[ignore]` is often used for failing tests, while the default set is typically used to filter out tests that are very slow or require specific resources.
121+
In practice, `#[ignore]` is often used for failing tests, while the default filter is typically used to filter out tests that are very slow or require specific resources.
122122

123123
### `--skip` and `--exact`
124124

125-
<!-- md:version 0.9.80 -->
125+
<!-- md:version 0.9.81-->
126126

127-
Nextest accepts the `--skip` and `--exact` arguments after `--`, emulating the corresponding arguments accepted by `cargo test`. These arguments match test names.
127+
Nextest accepts the `--skip` and `--exact` arguments after `--`, emulating the corresponding
128+
arguments accepted by `cargo test`. The `--skip` and `--exact` arguments apply to test name filters
129+
passed in after `--`.
128130

129131
For example, to run all tests matching the substring `test3`, but not including `skip1` or `skip2`:
130132

131133
```
132134
cargo nextest run -- --skip skip1 --skip skip2 test3
133135
```
134136

135-
To run all tests matching either exactly `test1` or the substring `test2`:
137+
To run all tests matching exactly the names `test1` and `test2`:
136138

137139
```
138-
cargo nextest run -- --exact test1 test2
140+
cargo nextest run -- test1 test2 --exact
141+
```
142+
143+
To run all tests except those matching exactly `slow_module::my_test`:
144+
145+
```
146+
cargo nextest run -- --exact --skip slow_module::my_test
139147
```
140148

141149
Alternatively, and in prior versions of nextest, use a [filterset](filtersets/index.md). Some examples:
142150

143-
| Cargo test command | Nextest command |
144-
| :---------------------------------------------: | :-----------------------------------------------------: |
145-
| `cargo test -- --skip skip1 --skip skip2 test3` | `cargo nextest run -E 'test(test3) - test(/skip[12]/)'` |
146-
| `cargo test -- --exact test1 test2` | `cargo nextest run -E 'test(=test1) + test(=test2)'` |
151+
| `cargo test` command | Nextest filterset command |
152+
| :-------------------------------------------------: | :-----------------------------------------------------: |
153+
| `cargo test -- --skip skip1 --skip skip2 test3` | `cargo nextest run -E 'test(test3) - test(/skip[12]/)'` |
154+
| `cargo test -- test1 test2 --exact` | `cargo nextest run -E 'test(=test1) + test(=test2)'` |
155+
| `cargo test -- --exact --skip slow_module::my_test` | `cargo nextest run -E 'not test(=slow_module::my_test)` |
147156

148157
### Filtering by build platform
149158

@@ -152,7 +161,9 @@ While cross-compiling code, some tests (e.g. proc-macro tests) may need to be ru
152161
For example, to only run tests for the host platform:
153162

154163
```
164+
155165
cargo nextest run -E 'platform(host)'
166+
156167
```
157168

158169
[filterset DSL]: filtersets/index.md

0 commit comments

Comments
 (0)