-
Notifications
You must be signed in to change notification settings - Fork 218
Add pipeline level nf-tests for template #2992
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
Add pipeline level nf-tests for template #2992
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the tooling (especially linting) in place before we can merge this into the template. Would also be nice if it would not break the CI for pipelines with nf-test, because this feels like a quite bullish push.
Co-authored-by: Matthias Hörtenhuber <[email protected]>
Co-authored-by: Matthias Hörtenhuber <[email protected]>
| params { | ||
| // Base directory for nf-core/modules test data | ||
| modules_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/modules/' | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pipelines_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/PIPELNE/' | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be done on line 11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOOD FOR ME as long as you deal with the pipelines_testdata_base_path params
This shouldn't break any pipelines with existing nf-tests, in fact it should complement them pretty well. There may be merge conflicts but all of the existing nf-tested pipelines should be mostly compatible. I've checked fetchngs, rnaseq, sarek, methylseq and phageannotator which are as far as I'm aware the main nf-tested pipelines. |
|
|
||
| name "Test pipeline with default settings" | ||
| script "../main.nf" | ||
| tag {{ name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mashehu what is wrong with this jinja templating? From my understanding this should be a tag of the pipeline name but it is being interpreted as a closure.
@mashehu what should we lint for here? We need to check that |
Sorry, I meant CI for pipelines without nf-test. Or do you think we can push easily every pipeline to switch to nf-test? |
Yes, at least file existence and a minimum set of assertions. See linting for components. |
|
|
||
| name "Test pipeline with default settings" | ||
| script "../main.nf" | ||
| // tag {{ name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this failing? I tested it, and it seems to work, it's replaced by the pipeline name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: I think it has to go between quotes tag "{{ name }}"
|
|
||
| then { | ||
| assertAll( | ||
| { assert workflow.success } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add "TODO nf-core" comments and link to documentation on how to assert different files, are more tests with other profiles, etc.
I personally would prefer to push people to nf-test rather than |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files☔ View full report in Codecov by Sentry. |
Annoying. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! sorry for the late review :)
This PR adds nf-test to the pipeline template, based on the work in nf-core/fetchngs and nf-core/rnaseq. Adds a simple default test and replaces the
nextflow runcommand withnf-test testfor more advanced testing. The default test just checks for a successful exit status, which should keep it lightweight and similar to existing tests.see nf-core/website#2536 for related documentation to PR.
PR checklist
CHANGELOG.mdis updateddocsis updated