Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4ed1b68
Start adding nf-tests
sofstam Oct 9, 2025
8bf2634
Add diamond snap
sofstam Oct 9, 2025
71d6871
Add nonpareil
sofstam Oct 16, 2025
e6bd9d7
Add non-pareil
sofstam Oct 21, 2025
d9c451f
Remove bracken from .nftignore
sofstam Oct 21, 2025
ba7587f
Add multiqc to unstable patterns
sofstam Oct 21, 2025
0b11065
Remove trailing whitespaces
sofstam Oct 21, 2025
4bcc295
Remove some files
sofstam Oct 21, 2025
e6a3fc1
Update snapshot
sofstam Oct 22, 2025
4f9b489
Remove centrifuge from .nftignore
sofstam Oct 22, 2025
02384c5
Update snaps
Oct 23, 2025
f648259
Remove more files from .nftignore
Oct 23, 2025
7b9e01d
Add nf-test for kraken2
Oct 24, 2025
38f4e7d
Add bowtie2
Oct 24, 2025
0f7b403
Add more output files to snapshot
Oct 24, 2025
570e214
Snapshots for kaiju, kmcp, krona and metaphlan
Oct 24, 2025
bc690e3
Add metaphlan, nanoq, porechop_abi, samtools, taxpasta to snapshots
Oct 24, 2025
7af0f8c
Add md5 for taxpasta
Oct 28, 2025
1352e64
Update md5 assertions
Oct 28, 2025
f37ab27
Update the unstable files for bbduk
Oct 28, 2025
151fecb
Fix unstable files for fastp
Oct 28, 2025
1cd44fb
Update snaps for kaiju unstable files
Oct 28, 2025
22652de
Update snaps
Oct 28, 2025
ecce43f
Update snaps
Oct 28, 2025
3faf15d
Fix obsolete snapshots
Oct 29, 2025
362069d
Update tests/default.nf.test
sofstam Oct 29, 2025
50c48af
Update tests/default.nf.test
sofstam Oct 29, 2025
b4c600c
Update tests/default.nf.test
sofstam Oct 29, 2025
39837e0
Add md5 for all kraken2 files
Oct 29, 2025
d990ce8
Add content for each kraken2 file
Oct 29, 2025
f82e739
Update snapshots for kraken2 unstalbel files
Oct 29, 2025
39da5c5
Update pathways for kraken2 unstable files
Oct 29, 2025
3e3e7f3
Update kraken2 paths
Oct 29, 2025
bf0fa89
Update snapshots
Oct 29, 2025
974ff69
Remove the path from assertion
Oct 29, 2025
5c42f34
Add whole path for bowtie2
Oct 29, 2025
9fdc72b
Add more bracken files
Oct 30, 2025
a1ba47d
Add more files
Oct 30, 2025
1f3a09a
Define unstable files
Oct 30, 2025
043a37f
Add more files for fastp
Oct 30, 2025
19585d2
Add more tests
Nov 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions tests/.nftignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,6 @@ multiqc/multiqc_data/multiqc_data.json
multiqc/multiqc_data/multiqc_sources.txt
multiqc/multiqc_data/multiqc_software_versions.txt
multiqc/multiqc_data/*.txt
multiqc/multiqc_plots/{svg,pdf,png}/*.{svg,pdf,png}
multiqc/multiqc_report.html
fastqc/*_fastqc.{html,zip}
fastqc/*/*fastqc.zip
pipeline_info/*.{html,json,txt,yml}
bbduk/*.log
nonpareil/*.{npa,npc,npl,npo,png,json,png,tsv,txt,pdf,csv}
bracken/*combined_reports.txt
centrifuge/*/*.mapped.fastq.gz
centrifuge/*/*results.txt
centrifuge/*/*.unmapped.fastq.gz
diamond/*/*.{tsv,log,txt}
fastp/*.{html,zip,json,log}
kaiju/*/*.tsv
kaiju/*.txt
krona/*.html
ganon/*/*.log
kraken2/*/*.fastq.gz
metaphlan/*/*.{biom,txt}
porechop_abi/*.log
samtools/*.bam.bai
samtools/*.unmapped.bam
taxpasta/*.tsv
115 changes: 107 additions & 8 deletions tests/default.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,121 @@ nextflow_pipeline {
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_name: All files + folders in ${params.outdir}/ with a stable name
def stable_name_all = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
// stable_path: All files in ${params.outdir}/ with stable content
// def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')

//MultiQC
def stable_name_multiqc = getAllFilesFromDir("$outputDir/multiqc", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

//BBDuk
def stable_content_bbduk = getAllFilesFromDir("$outputDir/bbduk", relative: true, includeDir: false, ignore: ['*.log'], ignoreFile: null, include: ['*','**/*'])
def stable_name_bbduk = getAllFilesFromDir("$outputDir/bbduk", relative: true, includeDir: false, ignore: null , ignoreFile: null, include: ['**/*.fastq.gz'] )

//DIAMOND
def stable_content_diamond = getAllFilesFromDir("$outputDir/diamond", relative: true, includeDir: false, ignore: ['*/*.{tsv,log,txt}'], ignoreFile: null, include: ['*','**/*'])
def stable_name_diamond = getAllFilesFromDir("$outputDir/diamond", relative: true, includeDir: false, ignore: null , ignoreFile: null, include: ['**/*.{tsv,log,txt}'] )

//nonpareil
def stable_content_nonpareil = getAllFilesFromDir("$outputDir/nonpareil", relative: true, includeDir: false, ignore: ['*.{svg,npa}'] , ignoreFile: null, include: ['*','**/*'])
def stable_name_nonpareil = getAllFilesFromDir("$outputDir/nonpareil", relative: true, includeDir: false, ignore: null , ignoreFile: null, include: ['**/*.{svg,npa}'] )

//kraken2
def stable_content_kraken2 = getAllFilesFromDir("$outputDir/kraken2", relative: true, includeDir: false, ignore: ['**/*.fastq.gz'] , ignoreFile: null, include: ['*','**/*'])
def stable_name_kraken2 = getAllFilesFromDir("$outputDir/kraken2", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.fastq.gz'])

//bowtie2
def stable_name_bowtie2 = getAllFilesFromDir("$outputDir/bowtie2", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

//bracken
def stable_name_bracken = getAllFilesFromDir("$outputDir/bracken", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

//centrifuge
def stable_content_centrifuge = getAllFilesFromDir("$outputDir/centrifuge", relative: true, includeDir: false, ignore: ['**/*.fastq.gz'] , ignoreFile: null, include: ['*','**/*'])
def stable_name_centrifuge = getAllFilesFromDir("$outputDir/centrifuge", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

//fastp
def stable_content_fastp = getAllFilesFromDir("$outputDir/fastp", relative: true, includeDir: false, ignore: ['*.{log}'] , ignoreFile: null, include: ['*','**/*'])
def stable_name_fastp = getAllFilesFromDir("$outputDir/fastp", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.log'])

//ganon
def stable_name_ganon = getAllFilesFromDir("$outputDir/ganon", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

//kaiju
def stable_content_kaiju = getAllFilesFromDir("$outputDir/kaiju", relative: true, includeDir: false, ignore: ['*.{tsv}'] , ignoreFile: null, include: ['*','**/*'])
def stable_name_kaiju = getAllFilesFromDir("$outputDir/kaiju", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.tsv'])

//kmcp
def stable_name_kmcp = getAllFilesFromDir("$outputDir/kmcp", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

// krona
def stable_name_krona = getAllFilesFromDir("$outputDir/krona", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

// metaphlan
def stable_name_metaphlan = getAllFilesFromDir("$outputDir/metaphlan", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

// nanoq
def stable_name_nanoq = getAllFilesFromDir("$outputDir/nanoq", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

// porechop_abi
def stable_content_porechopabi = getAllFilesFromDir("$outputDir/porechop_abi", relative: true, includeDir: false, ignore: ['*.{log}'] , ignoreFile: null, include: ['*','**/*'])
def stable_name_porechopabi = getAllFilesFromDir("$outputDir/porechop_abi", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*.log'])

// samtools
def stable_name_samtools = getAllFilesFromDir("$outputDir/samtools", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])

//taxpasta
def stable_name_taxpasta = getAllFilesFromDir("$outputDir/taxpasta", relative: true, includeDir: false, ignore: null, ignoreFile: null, include: ['*', '**/*'])


assertAll(
{ assert workflow.success},
{ assert snapshot(
// Number of successful tasks
workflow.trace.succeeded().size(),
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we test pipelines on multiple Nextflow versions
removeNextflowVersion("$outputDir/pipeline_info/nf_core_taxprofiler_software_mqc_versions.yml"),
// All stable path name, with a relative path
// stable_name,
// All files with stable contents
//stable_path
).match() }
).match() },

{ assert new File("$outputDir/pipeline_info/nf_core_taxprofiler_software_mqc_versions.yml").exists() },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },

{ 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 ( stable_content_diamond, stable_name_diamond ).match("diamond" ) },
{ assert snapshot ( stable_content_nonpareil, stable_name_nonpareil ).match("nonpareil" ) },
{ assert snapshot (
stable_name_kraken2, stable_content_kraken2, file ("$outputDir/kraken2/db2/2613_db2.kraken2.kraken2.report.txt").text.contains("S288C"), file ("$outputDir/kraken2/db2/2611_db2.kraken2.kraken2.report.txt").text.contains("S288C"), file ("$outputDir/kraken2/db2/2612_db2.kraken2.kraken2.report.txt").text.contains("S288C"))
.match("kraken2") },
{ assert snapshot ( stable_name_bowtie2, file ("$outputDir/bowtie2/align/2613_ERR5766181.bowtie2.log").text.contains("overall alignment rate"), file ("$outputDir/bowtie2/align/2612_ERR5766176_B.bowtie2.log").text.contains("overall alignment rate"), file ("$outputDir/bowtie2/align/2612_ERR5766176.bowtie2.log").text.contains("overall alignment rate"), file ("$outputDir/bowtie2/align/2612_ERR5766180.bowtie2.log").text.contains("overall alignment rate"),
path("$outputDir/bowtie2/align/"))
.match("bowtie2" ) },
{ assert snapshot ( stable_name_bracken, file ("$outputDir/bracken/db1/2613_db1.bracken.tsv").text.contains("Homo sapiens"), file ("$outputDir/bracken/db1/2611_db1.bracken.tsv").text.contains("Homo sapiens"), file ("$outputDir/bracken/db1/2612_db1.bracken.tsv").text.contains("Homo sapiens"),
path("$outputDir/bracken/db1"))
.match("bracken") },
{ assert snapshot ( stable_name_centrifuge, file ("$outputDir/centrifuge/db3/2613_db3.centrifuge.report.txt").text.contains("Eucommia"), file ("$outputDir/centrifuge/db3/2612_db3.centrifuge.report.txt").text.contains("Eucommia"),
stable_content_centrifuge)
.match("centrifuge") },
{ assert snapshot ( file ("$outputDir/fastp/2613_ERR5766181.fastp.log").text.contains("Read pairs merged"),file ("$outputDir/fastp/2612_ERR5766176_B.fastp.log").text.contains("Read pairs merged"),file ("$outputDir/fastp/2612_ERR5766180.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"),file ("$outputDir/ganon/db1/2612_db1.ganon.tre").text.contains("Saccharomycetales"), file ("$outputDir/ganon/db1/2611_db1.ganon.tre").text.contains("Saccharomycetales"),
path("$outputDir/ganon/db1"))
.match("ganon") },
{ assert snapshot ( file ("$outputDir/kaiju/db6/2614_db6.kaiju.tsv").text.contains("ERR3201952.3225565"),file ("$outputDir/kaiju/db6/ERR3201952_db6.kaiju.tsv").text.contains("ERR3201952.1159044"),stable_content_kaiju, stable_name_kaiju ).match("kaiju") },
{ assert snapshot ( stable_name_kmcp, file ("$outputDir/kmcp/db1/2613_db1.kmcp.profile").text.contains("NW_024067565.1"),file ("$outputDir/kmcp/db1/2612_db1.kmcp.profile").text.contains("NW_024067565.1"),file ("$outputDir/kmcp/db1/2611_db1.kmcp.profile").text.contains("NW_024067565.1"),
path("$outputDir/kmcp/db1"))
.match("kmcp") },
{ assert snapshot ( stable_name_krona, path("$outputDir/krona")).match("krona" ) },
{ assert snapshot ( stable_name_metaphlan, file ("$outputDir/metaphlan/metaphlan4/2613_metaphlan4.metaphlan_profile.txt").text.contains("SGB4933_group")).match("metaphlan") },
{ 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 ( stable_name_samtools, file ("$outputDir/samtools/stats/2613_ERR5766181.stats").text.contains("mismatches:")).match("samtools") },
{ assert snapshot(path("$outputDir/samtools/stats/2613_ERR5766181.stats").md5).match("samtools_md5") },
{ assert snapshot ( stable_name_taxpasta, file ("$outputDir/taxpasta/metaphlan_metaphlan4.tsv").text.contains("186803")).match("taxpasta") },
{ assert snapshot(path("$outputDir/taxpasta/metaphlan_metaphlan4.tsv").md5).match("taxpasta_md5") },
)
}
}
Expand Down
Loading