-
Notifications
You must be signed in to change notification settings - Fork 77
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
Replace tags strategy with implicit 'tags in test' strategy #253
Conversation
Changes: - All modules, subworkflows and workflows include their own name as a tag - All subworkflows and workflows include their dependencies as a tag - By detecting tags with `nf-test list --tags` we can extract all tags - Should be able to flag changed modules and dependent workflows without using a tags.yml file
|
subworkflows/nf-core/fastq_download_prefetch_fasterqdump_sratools/tests/main.nf.test
Outdated
Show resolved
Hide resolved
tag "UNTAR" | ||
tag "SRATOOLS_FASTERQDUMP" |
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.
I'll put the thing we're actually testing first, and then a break line, and then the dependency
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.
Done now. The format is:
thing "NAME"
tag "NAME"
tag "DEPENDENCY"
tag "MULTIQC_MAPPINGS_CONFIG" | ||
tag "SRA_FASTQ_FTP" | ||
tag "SRA_IDS_TO_RUNINFO" | ||
tag "SRA_RUNINFO_TO_FTP" | ||
tag "SRA_TO_SAMPLESHEET" |
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.
Hmmm...we have to be explicit with all of the workflow dependencies here now?
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.
Could be quite easy to lose track of these as you update the pipeline / workflow....
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.
Yes we do. Not ideal, but hard to do automatically. See askimed/nf-test#179 for relevant ticket.
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.
I had exactly the same thought as Harshil, don't think people will be very good at keeping these lists up to date. But I see the difficulties.
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.
No magic bullet so far. I've proposed automatically testing dependencies, but I also think nf-test can only go so far and it might just have to be the resposibility of the pipeline developer.
Awesome work @adamrtalbot ! 🤩 Few minor niggles I think we should discuss tomorrow. |
This reverts commit b1b117d.
files_yaml: | | ||
".": | ||
- .github/workflows/** | ||
- nf-test.config | ||
- nextflow.config | ||
tests: | ||
- assets/* | ||
- bin/* | ||
- conf/* | ||
- main.nf | ||
- nextflow_schema.json |
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.
@maxulysse shall we put this in a separate file?
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.
I'm sorry I don't understand what you meant by that.
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.
These are supplementary existing tags. We can move this to a separate YAML, e.g. .github/test_paths.yml
like we have tags now.
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.
Oh I see
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.
Further discussion - general consensus was it's all in one place if we leave it here. We can move it out later if we need to.
See https://github.com/adamrtalbot/fetchngs/pulls?q=is%3Aopen+is%3Apr+label%3Atags for example PRs including these changes. Feel free to suggest or create more! |
@pinin4fjords could you take a look with fresh eyes? I can talk you through it but I'd like someone coming in blind. |
Replace Nextflow versioning with simple list matrix
tests/main.nf.test
Outdated
tag "pipeline_fetchngs" | ||
tag "PIPELINE" | ||
|
||
tag "SRA" |
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.
why the SRA tag here?
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.
It's the immediate dependency of the pipeline. Perhaps we just run pipeline level tests at this point?
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.
OK I've removed it now. It will not test the workflow tests when we launch pipeline level tests anymore.
We can put it back if that behaviour feels weird.
workflows/sra/tests/main.nf.test
Outdated
tag "sra_default_parameters" | ||
|
||
|
||
// Subworkflows |
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.
// Subworkflows | |
// Workflow |
This one is a "workflow"
workflows/sra/tests/main.nf.test
Outdated
// Subworkflows | ||
tag "SRA" | ||
|
||
// 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.
// Modules | |
// Dependencies |
I'd rather we be explicit there and say dependencies, as any at this level "workflow" can contain modules and/or subworkflows
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 idea.
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.
Makes sense- just using tags for changed files to drive the tests in the CI, right?
It's just a shame we can't automatically infer workflows/ subworkflows for changed modules, keeping those lists up to date worries me as well.
tag "modules_local" | ||
tag "multiqc_mappings_config" | ||
|
||
tag "MULTIQC_MAPPINGS_CONFIG" |
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.
Not for this PR- but if tag is becoming redundant with the process maybe we should talk to the nf-test folks about allowing nf-test to list processes/ workflows rather than tags?
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.
I think it's similar to what @adamrtalbot meant when creating this issue: askimed/nf-test#178
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.
Correct, I've suggested it as a feature. This was the behaviour in pytest-workflow as well.
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.
Gotcha, sorry for the slow uptake
tag "MULTIQC_MAPPINGS_CONFIG" | ||
tag "SRA_FASTQ_FTP" | ||
tag "SRA_IDS_TO_RUNINFO" | ||
tag "SRA_RUNINFO_TO_FTP" | ||
tag "SRA_TO_SAMPLESHEET" |
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.
I had exactly the same thought as Harshil, don't think people will be very good at keeping these lists up to date. But I see the difficulties.
tag "modules_nfcore" | ||
tag "custom" | ||
tag "custom/sratoolsncbisettings" | ||
|
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.
Changes in nf-core things will be patches, right?
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.
Yep. Will need a patch.
tag 'subworkflows' | ||
tag 'utils_nfcore_fetchngs_pipeline' | ||
tag 'subworkflows/utils_nfcore_fetchngs_pipeline' | ||
tag "UTILS_NFCORE_FETCHNGS_PIPELINE" |
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.
@maxulysse is this the right tag? Too late on a Friday to confirm. Please check on Monday 😆
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.
yes
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.
Best nf-test CI contribution since slided bread! 🤩
Using implicit tags
Replacement strategy to replace tags with tags present in nf-test files.
Subject to change, expect the unexpected.
Changes:
nf-test list --tags
on any directory with a changed file to find all tags associated with changesfiles_yaml
block of the actiontests/
directory withnf-test list --tags
.To do:
nf-test list --tags
PR checklist
nf-core lint
).nextflow run . -profile test,docker --outdir <OUTDIR>
).nextflow run . -profile debug,test,docker --outdir <OUTDIR>
).docs/usage.md
is updated.docs/output.md
is updated.CHANGELOG.md
is updated.README.md
is updated (including new tool citations and authors/contributors).