You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/src/docs/filtersets/index.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
Nextest supports a domain-specific language (DSL) for choosing sets of tests called **filtersets** (formerly **filter expressions**). The DSL is inspired by, and is similar to, [Bazel query](https://bazel.build/docs/query-how-to) and [Mercurial revsets](https://www.mercurial-scm.org/repo/hg/help/revsets).
4
4
5
+
Filtersets are specified on the command line with `-E`, or `--filterset`<!-- md:version 0.9.76 -->. (In prior versions of nextest, use `--filter-expr`.)
6
+
5
7
## Example: Running all tests in a crate and its dependencies
6
8
7
9
To run all tests in `my-crate` and its dependencies, run:
@@ -26,6 +28,16 @@ This is equivalent to:
26
28
cargo nextest run -E 'test(my_test) + package(my-crate)'
27
29
```
28
30
31
+
!!! warning "If both filtersets and substring filters are specified..."
32
+
33
+
If you pass in both a filterset and a substring-based filter, tests must match **both** of them. In other words, the union of all filtersets is intersected with the union of substring filters.
34
+
35
+
For example, the command:
36
+
37
+
cargo nextest run -E 'package(foo)' -- test_bar test_baz
38
+
39
+
will run all tests that meet **both** conditions: in package `foo`, and match either `test_bar` or `test_baz`.
: Matches every test not matching the regex `parse[0-9]*` or the substring `run`.
39
51
40
-
!!! warning "If both filtersets and substring filters are specified..."
52
+
### Filtersets with the default set
41
53
42
-
If you pass in both a filterset and a substring-based filter, tests must match **both** of them. In other words, the union of all filtersets is intersected with the union of substring filters.
54
+
<!-- md:version 0.9.76 -->
43
55
44
-
For example, the command:
56
+
If [a default set](../running.md#running-a-subset-of-tests-by-default) of tests is configured, then filtersets on the command line are intersected with the default set.
45
57
46
-
cargo nextest run -E 'package(foo)' -- test_bar test_baz
58
+
To match against all tests, not just the default set, pass in `--bound=all`.
47
59
48
-
will run all tests that meet **both** conditions: in package `foo`, and match either `test_bar` or `test_baz`.
60
+
Filtersets specified in configuration (for example, in [per-test
61
+
settings](../configuration/per-test-overrides.md), or `default-set` itself) do not take into account
0 commit comments