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

Only run tests for changed files #199

Closed
edmundmiller opened this issue Feb 6, 2024 · 4 comments
Closed

Only run tests for changed files #199

edmundmiller opened this issue Feb 6, 2024 · 4 comments

Comments

@edmundmiller
Copy link
Contributor

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.

@adamrtalbot
Copy link

As usual, the simplest solution is probably the best.

@adamrtalbot
Copy link

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.

@lukfor
Copy link
Collaborator

lukfor commented Feb 14, 2024

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! 🚀

@kenibrewer
Copy link
Contributor

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 !

@lukfor lukfor closed this as completed Oct 14, 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

No branches or pull requests

4 participants