-
Notifications
You must be signed in to change notification settings - Fork 59
Add more nf tests #655
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
base: dev
Are you sure you want to change the base?
Add more nf tests #655
Conversation
|
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 3.3.2. For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation. |
|
Should we also add |
Yes! On my to-do list, just started with the test config first :) |
|
So will you add all those nf-test to this PR? |
|
I was thinking one PR for each 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.
We are getting pretty close now!
- Minor: check indentation of the lines so they are consistent
- Minor: in a few places you have put the stable_name, stable_contents in a list, but not others, I don't know why you've done this but I don't think it's necessary(?) and if yes I would try and be consistent across all
- You don't need to separate snapshots per direct and assertion type, you can include multiple assertion types in a single named snapshot (I wrote a couple of examples as suggestions
- It appears when you are checking specific files you are only calling single samples, I would apply the same assertion across all samples of a file
- You explicitly call
.md5to generate these, you shouldn't need to do this - just give thepath()(using the.md5function removes the file name, so it's harder to know which md5sum corresponds to which file in the snapshot
|
|
||
| { assert snapshot ( stable_name_all ).match("all_files") }, | ||
| { assert snapshot ( stable_name_multiqc ).match("multiqc" ) }, | ||
| { assert snapshot( file("$outputDir/bbduk/2613_ERR5766181.bbduk.log").text.contains("Reads Processed:"), [stable_content_bbduk, stable_name_bbduk]).match("bbduk")}, |
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 have you put content/name as a list here?, they can be independent entries
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 will do so!
| { assert snapshot(path("$outputDir/metaphlan/metaphlan4/2613_metaphlan4.metaphlan_profile.txt").md5).match("metaphlan_profile_md5") }, | ||
| { assert snapshot ( stable_name_nanoq, file ("$outputDir/nanoq/ERR3201952_ERR3201952_filtered.stats").text.contains("Median read quality")).match("nanoq") }, | ||
| { assert snapshot(path("$outputDir/nanoq/ERR3201952_ERR3201952_filtered.stats").md5).match("nanoq_md5") }, | ||
| { assert snapshot ( file ("$outputDir/porechop_abi/ERR3201952_ERR3201952_porechop_abi.log").text.contains("reads were split"), [stable_name_porechopabi, stable_content_porechopabi]).match("porechop_abi") }, |
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.
The list thingy again here...
| { assert snapshot ( file ("$outputDir/fastp/2613_ERR5766181.fastp.log").text.contains("Read pairs merged"),[stable_content_fastp, stable_name_fastp] ).match("fastp") }, | ||
| { assert snapshot ( stable_name_ganon, file ("$outputDir/ganon/db1/2613_db1.ganon.tre").text.contains("Saccharomycetales")).match("ganon") }, | ||
| { assert snapshot(path("$outputDir/ganon/db1/2613_db1.ganon.tre").md5).match("ganon_md5") }, | ||
| { assert snapshot ( file ("$outputDir/kaiju/db6/2614_db6.kaiju.tsv").text.contains("ERR3201952.3225565"),[stable_content_kaiju, stable_name_kaiju] ).match("kaiju") }, |
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.
And the list again here...
| { assert snapshot(path("$outputDir/centrifuge/db3/2613_db3.centrifuge.report.txt").md5).match("centrifuge_md5") }, | ||
| { assert snapshot ( file ("$outputDir/fastp/2613_ERR5766181.fastp.log").text.contains("Read pairs merged"),[stable_content_fastp, stable_name_fastp] ).match("fastp") }, | ||
| { assert snapshot ( stable_name_ganon, file ("$outputDir/ganon/db1/2613_db1.ganon.tre").text.contains("Saccharomycetales")).match("ganon") }, | ||
| { assert snapshot(path("$outputDir/ganon/db1/2613_db1.ganon.tre").md5).match("ganon_md5") }, |
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 are you only checking a single sample here? And same for the others...
Co-authored-by: James A. Fellows Yates <[email protected]>
Co-authored-by: James A. Fellows Yates <[email protected]>
Co-authored-by: James A. Fellows Yates <[email protected]>
This is a draft of adding nf-tests.
PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).