Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter by complex query #283

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Filter by complex query #283

wants to merge 3 commits into from

Conversation

lukfor
Copy link
Collaborator

@lukfor lukfor commented Dec 26, 2024

This pull request introduces enhanced functionality for tag-based testing (see #180):

Exclude Tags That Begin with !

Tags prefixed with ! can now be excluded from the test run. For example:

nf-test test --tag tag1,!tag2

This command will run tests with the tag tag1 but exclude those with the tag tag2.

Run Tests Matching Complex Queries

It is now possible to specify complex queries using logical expressions. For example:

nf-test test --query "(tags['tag1'] && !tags['tag2']) || tags['tag3']"

This query will run tests that:

  • Have tag1 but not tag2, or
  • Have tag3.

Filter by testsuite name:

nf-test test --query "name == 'test suite 1'"

Filter by test name:

nf-test test --query "test == 'test1'"

TODO

  • Filename: Add the ability to match based on file names.

@lukfor lukfor changed the title Exclude tags that begin with ! Filter by complex query Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant