Add --skip flag to exclude tests by name pattern#660
Add --skip flag to exclude tests by name pattern#660OmChillure wants to merge 2 commits intokarva-dev:mainfrom
Conversation
5d7ae98 to
fea3b8c
Compare
|
You'll need to run |
Merging this PR will not alter performance
|
Hey did this in the latest commit |
26d61a8 to
8c2c1c4
Compare
|
Thank you so much for this! I am going to need to think about this more. I am quite keep to do something like #546. Meaning we will have a single cli option to filter tests, meaning we can do all three in one. I do apologise for having this issue open without mentioning this in the issue itself. I don't get PRs very often. So I appreciate the time you've taken to do this, but I don't want to merge this just to then remove the functionality soon after. Thanks again! |
Ohh no worries at all ! Thanks for checking it though. As mentioned in #546, I had a look at the codebase how can we potentailly do those changes, all these will take a good amount of time. And seeing your comment on #546,, ig you are thinking on the correct approach? Let me know if I can help here if you have decided to move ahead. Thank you |
Closes #549.
This adds a --skip flag to karva test that excludes tests whose fully qualified name matches a regular expression the inverse of --match. Multiple patterns can be combined; a test is skipped if it matches any of them.
Implementation
The flag reuses the existing NameFilterSet type from karva_metadata — no new filter type was needed. The skip logic sits alongside the name-filter check in should_skip_variant: a test is filtered out if name_filter rejects it or skip_filter matches it, computing display_name only once when either filter is active.
Invalid regex patterns are caught upfront in the main process (before any workers spawn), consistent with the existing --match and --tag validation, so users get a clean error with exit_code: 2 immediately.
The flag is forwarded from the orchestrator to each worker via --skip in inner_cli_args, mirroring how --match is forwarded.
Changes
Screenshots
A] All tests running

B] Skipping tests with
--skipflag forslow_C] Skipping tests wiht
--skipflag forintegration