Skip to content

Conversation

@sofstam
Copy link
Collaborator

@sofstam sofstam commented Oct 9, 2025

This is a draft of adding nf-tests.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/taxprofiler branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 043a37f

+| ✅ 292 tests passed       |+
!| ❗  18 tests had warnings |!

❗ Test warnings:

  • files_exist - File not found: conf/igenomes.config
  • files_exist - File not found: conf/igenomes_ignored.config
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • local_component_structure - kraken2_standard_report.nf in modules/local should be moved to a TOOL/SUBTOOL/main.nf structure
  • local_component_structure - krona_cleanup.nf in modules/local should be moved to a TOOL/SUBTOOL/main.nf structure
  • local_component_structure - visualization_krona.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - shortread_complexityfiltering.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - profiling.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - longread_hostremoval.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - longread_preprocessing.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - shortread_fastp.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - longread_adapterremoval.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - standardisation_profiles.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - shortread_preprocessing.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - shortread_adapterremoval.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - longread_filtering.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - nonpareil.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - shortread_hostremoval.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure

✅ Tests passed:

Run details

  • nf-core/tools version 3.3.2
  • Run at 2025-10-30 14:10:57

@nf-core-bot
Copy link
Member

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.
Please update your pipeline to the latest version.

For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation.

@LilyAnderssonLee
Copy link
Contributor

Should we also add nf-test to other test configs?

@LilyAnderssonLee LilyAnderssonLee marked this pull request as ready for review October 23, 2025 12:57
@sofstam
Copy link
Collaborator Author

sofstam commented Oct 23, 2025

Should we also add nf-test to other test configs?

Yes! On my to-do list, just started with the test config first :)

@LilyAnderssonLee
Copy link
Contributor

So will you add all those nf-test to this PR?

@sofstam
Copy link
Collaborator Author

sofstam commented Oct 23, 2025

I was thinking one PR for each config.

Copy link
Member

@jfy133 jfy133 left a 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!

  1. Minor: check indentation of the lines so they are consistent
  2. 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
  3. 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
  4. 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
  5. You explicitly call .md5 to generate these, you shouldn't need to do this - just give the path() (using the .md5 function 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")},
Copy link
Member

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

Copy link
Collaborator Author

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") },
Copy link
Member

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") },
Copy link
Member

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") },
Copy link
Member

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...

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

Successfully merging this pull request may close these issues.

5 participants