askimed/nf-test

Only run tests for changed files

edmundmiller opened this issue · 4 comments

So there's been an on going effort to only run the tests of files that have changed.(Time, trees, etc.) @adamrtalbot has written some impressive mind-bending yaml to do so on fetchngs as an example.

I think the yaml and the explaination of all of it has gotten extremely complicated and difficult to understand for even those leading the effort...

What if we just had the functionality baked into nf-test? It might be more clever, easier for developers to understand, AND would work locally out of the box.

  1. Look for what's changed in the git repo ie modules/bowtie/main.nf
  2. Find any tests that include or point to that file. script "modules/bowtie/main.nf"
  3. Run those tests.

The issue is then finding the subworkflows and workflows that include that module. That might be a Nextflow issue, but we could probably get away with some simple rg include modules/bowtie/main.nf type of thing, and then repeat the above process for each of those files.

Then end users would just see

nf-test tests --changed

Which could be a config setting as well.

As usual, the simplest solution is probably the best.

Having said that, what does 'changed' mean here? I don't think we can assume Git, so changed since the test was last written? nf-test should do one thing well, testing strategies probably should be in the implementation.

Hi all, we have been working for some time now on building a dependency graph between modules, workflows, and test files. This will enable us to calculate test coverage and determine which tests need to be run for a particular Nextflow file. Stay tuned! 🚀

This issue is now covered by a variety of new options in the cli (See https://www.nf-test.com/docs/cli/test/#optimizing-test-execution ). It can probably be closed.

Thanks for the awesome feature @lukfor !