nf-test icon indicating copy to clipboard operation
nf-test copied to clipboard

Filter by complex query

Open lukfor opened this issue 1 year ago • 2 comments

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 avatar Dec 26 '24 21:12 lukfor

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

edmundmiller avatar Jun 03 '25 14:06 edmundmiller

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

jfy133 avatar Jun 18 '25 09:06 jfy133