Skip to content

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
@edmundmiller
Copy link
Collaborator

Hey @lukfor any updates on this PR? We'd love to start using it in nf-core!

@jfy133
Copy link
Contributor

jfy133 commented Jun 18, 2025

Yes please! This will be come more common with nf-core now we have pipeline level tests too

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.

4 participants