[nextest-filtering] add group() filterset predicate for CLI filters#3273
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3273 +/- ##
==========================================
+ Coverage 85.46% 85.51% +0.04%
==========================================
Files 159 160 +1
Lines 47300 47814 +514
==========================================
+ Hits 40424 40887 +463
- Misses 6876 6927 +51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR extends nextest’s filterset language with a group() predicate for CLI -E filters, enabling users to select tests by configured test group. It also wires group validation and evaluation end-to-end across cargo-nextest, nextest-runner, and nextest-filtering, including test coverage and a debug utility for parsing filtersets.
Changes:
- Add
group()as a runtime-only predicate innextest-filtering, including compile-time validation viaKnownGroupsand evaluation viaGroupLookup. - Precompute per-test group membership in
nextest-runner(from overrides that settest-group) and pass that lookup into CLI expression evaluation. - Add
cargo nextest debug parse-filtersetplus new/updated integration snapshots for banned predicates.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| nextest-runner/src/test_filter.rs | Adds group-aware expression matching and has_group_predicates() gating. |
| nextest-runner/src/runner/executor.rs | Switches global group env var to shared metadata constant. |
| nextest-runner/src/list/test_list.rs | Precomputes group membership when needed and passes GroupLookup into filtering; adds tests. |
| nextest-runner/src/config/scripts/imp.rs | Updates filterset parsing calls to pass KnownGroups. |
| nextest-runner/src/config/overrides/mod.rs | Exposes new group_membership module. |
| nextest-runner/src/config/overrides/imp.rs | Introduces OverrideFilter kind; centralizes override applicability logic; updates banned-predicate labels. |
| nextest-runner/src/config/overrides/group_membership.rs | New group membership precomputation + GroupLookup impl + unit tests. |
| nextest-runner/src/config/elements/test_group.rs | Uses shared GLOBAL_TEST_GROUP constant for parsing/deserialization. |
| nextest-runner/src/config/core/imp.rs | Adds known_groups() and precompute_group_memberships() on profiles. |
| nextest-metadata/src/test_list.rs | Defines and exports GLOBAL_TEST_GROUP. |
| nextest-filtering/tests/match.rs | Expands parsing calls to include KnownGroups; adds extensive group() tests and banned-predicate tests. |
| nextest-filtering/src/proptest_helpers.rs | Adds Group leaf to proptest generation. |
| nextest-filtering/src/parsing.rs | Adds group() leaf parsing and display; marks it runtime-only. |
| nextest-filtering/src/lib.rs | Re-exports GroupLookup and KnownGroups. |
| nextest-filtering/src/expression.rs | Implements group() evaluation, GroupLookup, KnownGroups, and OverrideFilter kind. |
| nextest-filtering/src/errors.rs | Adds NoGroupMatch; refines banned predicate reasons/messages. |
| nextest-filtering/src/compile.rs | Validates group() against known groups; bans predicates by filterset kind; early-return on banned predicates. |
| nextest-filtering/examples/parser.rs | Updates example to pass KnownGroups. |
| integration-tests/tests/integration/snapshots/integration__banned_test_in_archive_filter.snap | New snapshot for banned test() in archive filtersets. |
| integration-tests/tests/integration/snapshots/integration__banned_group_in_override_filter.snap | New snapshot for banned group() in override filtersets. |
| integration-tests/tests/integration/snapshots/integration__banned_group_in_default_filter.snap | New snapshot for banned group() in default-filter expressions. |
| integration-tests/tests/integration/snapshots/integration__banned_group_in_archive_filter.snap | New snapshot for banned group() in archive filtersets. |
| integration-tests/tests/integration/snapshots/integration__banned_default_in_default_filter.snap | New snapshot for banned default() in default-filter expressions. |
| integration-tests/tests/integration/snapshots/integration__archive_unsupported_build_filter.snap | Snapshot updated with assertion line metadata. |
| integration-tests/tests/integration/main.rs | Adds integration test covering banned predicates via debug parse-filterset. |
| cargo-nextest/src/errors.rs | Adds DebugParseFiltersetError expected error variant and exit code mapping. |
| cargo-nextest/src/dispatch/utility/debug.rs | Adds debug parse-filterset subcommand with optional cargo-metadata input. |
| cargo-nextest/src/dispatch/helpers.rs | Extends build_filtersets to accept KnownGroups. |
| cargo-nextest/src/dispatch/core/run.rs | Supplies known_groups when building CLI test filtersets. |
| cargo-nextest/src/dispatch/core/list.rs | Supplies known_groups when building CLI test filtersets. |
| cargo-nextest/src/dispatch/core/archive.rs | Supplies KnownGroups::Unavailable for archive filtersets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
62298e8 to
a8d91b2
Compare
Add a new filterset predicate, `group()`, to list tests by test group.
a8d91b2 to
4034150
Compare
Add a new filterset predicate,
group(), to list tests by test group.