Skip to content

Commit 6b720d6

Browse files
committed
add tests
1 parent 7f89dc2 commit 6b720d6

7 files changed

+78
-945
lines changed

tests/test_maxquant.nf.test

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
nextflow_pipeline {
2+
3+
name "Test Workflow main.nf - DIFFERENTIALABUNDANCE (maxquant)"
4+
script "../main.nf"
5+
tag "maxquant"
6+
tag "pipeline"
7+
profile "test_maxquant,maxquant"
8+
9+
test("Test maxquant profile") {
10+
11+
when {
12+
params {
13+
outdir = "$outputDir"
14+
study_name = 'PXD043349'
15+
config_profile_name = 'MaxQuant test profile'
16+
config_profile_description = 'MaxQuant test dataset to check pipeline function'
17+
18+
}
19+
}
20+
21+
then {
22+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
23+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
24+
// stable_path: All files in ${params.outdir}/ with stable content
25+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
26+
assertAll(
27+
{ assert workflow.success},
28+
{ assert snapshot(
29+
// Number of successful tasks
30+
workflow.trace.succeeded().size(),
31+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
32+
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
33+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_differentialabundance_software_versions.yml"),
34+
// All stable path name, with a relative path
35+
stable_name,
36+
// All files with stable contents
37+
stable_path
38+
).match() }
39+
)
40+
}
41+
}
42+
43+
test("Test maxquant profile - with toolsheet") {
44+
45+
when {
46+
params {
47+
outdir = "$outputDir"
48+
paramset_name = "limma_maxquant"
49+
differential_method = null
50+
}
51+
52+
}
53+
54+
then {
55+
// stable_name: All files + folders in ${params.outdir}/ with a stable name
56+
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}'])
57+
// stable_path: All files in ${params.outdir}/ with stable content
58+
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore')
59+
assertAll(
60+
{ assert workflow.success},
61+
{ assert snapshot(
62+
// Number of successful tasks
63+
workflow.trace.succeeded().size(),
64+
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions
65+
removeNextflowVersion("$outputDir/pipeline_info/collated_versions.yml"),
66+
removeNextflowVersion("$outputDir/pipeline_info/nf_core_differentialabundance_software_versions.yml"),
67+
// All stable path name, with a relative path
68+
stable_name,
69+
// All files with stable contents
70+
stable_path
71+
).match() }
72+
)
73+
}
74+
}
75+
}

tests/test_maxquant.nf.test.bak

Lines changed: 0 additions & 162 deletions
This file was deleted.
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@
118118
"tables/proteus/fakeBatch/raw_proteingroups_tab.tsv"
119119
],
120120
[
121-
"fakebatch_fakeBatch_b1_b2_PXD043349.MArrayLM.limma.rds:md5,f321bf1e4fd44827810df9a9c38776d6",
122-
"genotype_celltype_t1_FoB_PXD043349.MArrayLM.limma.rds:md5,4f0cb9d82aa3c0464cee5eca69248589",
123-
"genotype_celltype_t1_MZ_fakeBatch_PXD043349.MArrayLM.limma.rds:md5,2021a25cc716b10830ff6851044b6b9d",
124-
"genotype_celltype_t1_t2_PXD043349.MArrayLM.limma.rds:md5,34cc962386f20c6e001ab28f035df781",
125121
"normalizeMedian.normalized_proteingroups.rds:md5,da660b225f066a1e87bf8bb4196adcc6",
126122
"raw_proteingroups.rds:md5,0b38726c41e7b32213e5e15380c29612",
127123
"R_sessionInfo.log:md5,411badddf7904da0ed1de02b544109d2",
@@ -147,7 +143,7 @@
147143
"nf-test": "0.9.2",
148144
"nextflow": "25.04.3"
149145
},
150-
"timestamp": "2025-06-12T13:43:40.418435866"
146+
"timestamp": "2025-06-17T13:00:28.84951094"
151147
},
152148
"Test maxquant profile - with toolsheet": {
153149
"content": [
@@ -268,10 +264,6 @@
268264
"tables/proteus/fakeBatch/raw_proteingroups_tab.tsv"
269265
],
270266
[
271-
"fakebatch_fakeBatch_b1_b2_PXD043349.MArrayLM.limma.rds:md5,f321bf1e4fd44827810df9a9c38776d6",
272-
"genotype_celltype_t1_FoB_PXD043349.MArrayLM.limma.rds:md5,4f0cb9d82aa3c0464cee5eca69248589",
273-
"genotype_celltype_t1_MZ_fakeBatch_PXD043349.MArrayLM.limma.rds:md5,2021a25cc716b10830ff6851044b6b9d",
274-
"genotype_celltype_t1_t2_PXD043349.MArrayLM.limma.rds:md5,34cc962386f20c6e001ab28f035df781",
275267
"normalizeMedian.normalized_proteingroups.rds:md5,da660b225f066a1e87bf8bb4196adcc6",
276268
"raw_proteingroups.rds:md5,0b38726c41e7b32213e5e15380c29612",
277269
"R_sessionInfo.log:md5,411badddf7904da0ed1de02b544109d2",
@@ -297,6 +289,6 @@
297289
"nf-test": "0.9.2",
298290
"nextflow": "25.04.3"
299291
},
300-
"timestamp": "2025-06-12T13:44:42.725584458"
292+
"timestamp": "2025-06-17T13:01:31.502573937"
301293
}
302-
}
294+
}

0 commit comments

Comments
 (0)