Add -t / --tag flag for filtering tests by custom tag expressions#422
Merged
MatthewMckee4 merged 2 commits intomainfrom Feb 7, 2026
Merged
Add -t / --tag flag for filtering tests by custom tag expressions#422MatthewMckee4 merged 2 commits intomainfrom
-t / --tag flag for filtering tests by custom tag expressions#422MatthewMckee4 merged 2 commits intomainfrom
Conversation
…#266) Implements tag expression filtering so users can selectively run tests based on custom tags like `@karva.tags.slow` or `@karva.tags.integration`. Expressions support `and`, `or`, `not`, and parentheses. Multiple `-t` flags use OR semantics. Also removes dead_code annotations from CustomTag fields now that they are actively used. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Project Diff ResultsNo changes between this PR and main. |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
32616c6 to
faf5fd4
Compare
…ute_test_variant` return type Relocate the filter module from `karva_cli` to `karva_metadata` so `TestSettings` can own the `TagFilterSet`. This removes the `tag_filter` field from `Context`, and changes `execute_test_variant` to return `bool` instead of `Option<bool>`, treating tag-filtered tests like skips (early return `true`). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
faf5fd4 to
cfcad5a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-t/--tagCLI flag for filtering tests by tag expressions (closes Support custom tags #266)and,or,not, and parentheses for grouping with correct operator precedence-tflags use OR semantics: a test runs if it matches any expression#[expect(dead_code)]fromCustomTagname field andTag::Customvariant, now that custom tags are actively readTest plan
just test