Skip to content

Commit 79a3af1

Browse files
maxulysseimsarath
authored andcommitted
Add stub and stub tests for bbmap/clumpify (#11987)
1 parent b92aca7 commit 79a3af1

3 files changed

Lines changed: 182 additions & 38 deletions

File tree

modules/nf-core/bbmap/clumpify/main.nf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,14 @@ process BBMAP_CLUMPIFY {
3131
$args \\
3232
&> ${prefix}.clumpify.log
3333
"""
34+
35+
stub:
36+
def prefix = task.ext.prefix ?: "${meta.id}"
37+
def output_command = meta.single_end ?
38+
"echo '' | gzip > ${prefix}.clumped.fastq.gz" :
39+
"echo '' | gzip > ${prefix}_1.clumped.fastq.gz ; echo '' | gzip > ${prefix}_2.clumped.fastq.gz"
40+
"""
41+
touch ${prefix}.clumpify.log
42+
$output_command
43+
"""
3444
}

modules/nf-core/bbmap/clumpify/tests/main.nf.test

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ nextflow_process {
2929
then {
3030
assertAll(
3131
{ assert process.success },
32-
{ assert snapshot(
33-
process.out.reads,
34-
file(process.out.log[0][1]).name,
35-
process.out.findAll { key, val -> key.startsWith('versions') }
36-
).match()
37-
}
32+
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["log"])).match() }
3833
)
3934
}
4035
}
@@ -59,12 +54,60 @@ nextflow_process {
5954
then {
6055
assertAll(
6156
{ assert process.success },
62-
{ assert snapshot(
63-
process.out.reads,
64-
file(process.out.log[0][1]).name,
65-
process.out.findAll { key, val -> key.startsWith('versions') }
66-
).match()
67-
}
57+
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["log"])).match() }
58+
)
59+
}
60+
}
61+
62+
test("test-bbmap-clumpify-single-end - stub") {
63+
64+
options "-stub"
65+
66+
when {
67+
process {
68+
"""
69+
input[0] = [
70+
[ id:'test', single_end:true ], // meta map
71+
[
72+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)
73+
]
74+
]
75+
76+
"""
77+
}
78+
}
79+
80+
then {
81+
assertAll(
82+
{ assert process.success },
83+
{ assert snapshot(sanitizeOutput(process.out)).match() }
84+
)
85+
}
86+
}
87+
88+
test("test-bbmap-clumpify-paired-end - stub") {
89+
90+
options "-stub"
91+
92+
when {
93+
process {
94+
"""
95+
input[0] = [
96+
[ id:'test', single_end:false ], // meta map
97+
[
98+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
99+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
100+
]
101+
]
102+
103+
"""
104+
}
105+
}
106+
107+
then {
108+
assertAll(
109+
{ assert process.success },
110+
{ assert snapshot(sanitizeOutput(process.out)).match() }
68111
)
69112
}
70113
}
Lines changed: 117 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,64 @@
11
{
22
"test-bbmap-clumpify-paired-end": {
33
"content": [
4-
[
5-
[
6-
{
7-
"id": "test",
8-
"single_end": false
9-
},
4+
{
5+
"log": [
6+
[
7+
{
8+
"id": "test",
9+
"single_end": false
10+
},
11+
"test.clumpify.log"
12+
]
13+
],
14+
"reads": [
1015
[
11-
"test_1.clumped.fastq.gz:md5,27e51643262c1ef3905c4be184c3814c",
12-
"test_2.clumped.fastq.gz:md5,c70ab7bbd44d6b6fadd6a1a79ef1648f"
16+
{
17+
"id": "test",
18+
"single_end": false
19+
},
20+
[
21+
"test_1.clumped.fastq.gz:md5,27e51643262c1ef3905c4be184c3814c",
22+
"test_2.clumped.fastq.gz:md5,c70ab7bbd44d6b6fadd6a1a79ef1648f"
23+
]
24+
]
25+
],
26+
"versions_bbmap": [
27+
[
28+
"BBMAP_CLUMPIFY",
29+
"bbmap",
30+
"39.18"
1331
]
1432
]
15-
],
16-
"test.clumpify.log",
33+
}
34+
],
35+
"timestamp": "2026-06-12T13:45:10.280022778",
36+
"meta": {
37+
"nf-test": "0.9.5",
38+
"nextflow": "26.04.3"
39+
}
40+
},
41+
"test-bbmap-clumpify-single-end": {
42+
"content": [
1743
{
44+
"log": [
45+
[
46+
{
47+
"id": "test",
48+
"single_end": true
49+
},
50+
"test.clumpify.log"
51+
]
52+
],
53+
"reads": [
54+
[
55+
{
56+
"id": "test",
57+
"single_end": true
58+
},
59+
"test.clumped.fastq.gz:md5,27e51643262c1ef3905c4be184c3814c"
60+
]
61+
],
1862
"versions_bbmap": [
1963
[
2064
"BBMAP_CLUMPIFY",
@@ -24,25 +68,72 @@
2468
]
2569
}
2670
],
27-
"timestamp": "2026-03-11T13:50:50.67389917",
71+
"timestamp": "2026-06-12T13:45:03.743249724",
2872
"meta": {
29-
"nf-test": "0.9.4",
30-
"nextflow": "25.10.4"
73+
"nf-test": "0.9.5",
74+
"nextflow": "26.04.3"
3175
}
3276
},
33-
"test-bbmap-clumpify-single-end": {
77+
"test-bbmap-clumpify-single-end - stub": {
3478
"content": [
35-
[
36-
[
37-
{
38-
"id": "test",
39-
"single_end": true
40-
},
41-
"test.clumped.fastq.gz:md5,27e51643262c1ef3905c4be184c3814c"
79+
{
80+
"log": [
81+
[
82+
{
83+
"id": "test",
84+
"single_end": true
85+
},
86+
"test.clumpify.log:md5,d41d8cd98f00b204e9800998ecf8427e"
87+
]
88+
],
89+
"reads": [
90+
[
91+
{
92+
"id": "test",
93+
"single_end": true
94+
},
95+
"test.clumped.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
96+
]
97+
],
98+
"versions_bbmap": [
99+
[
100+
"BBMAP_CLUMPIFY",
101+
"bbmap",
102+
"39.18"
103+
]
42104
]
43-
],
44-
"test.clumpify.log",
105+
}
106+
],
107+
"timestamp": "2026-06-12T13:45:15.652095723",
108+
"meta": {
109+
"nf-test": "0.9.5",
110+
"nextflow": "26.04.3"
111+
}
112+
},
113+
"test-bbmap-clumpify-paired-end - stub": {
114+
"content": [
45115
{
116+
"log": [
117+
[
118+
{
119+
"id": "test",
120+
"single_end": false
121+
},
122+
"test.clumpify.log:md5,d41d8cd98f00b204e9800998ecf8427e"
123+
]
124+
],
125+
"reads": [
126+
[
127+
{
128+
"id": "test",
129+
"single_end": false
130+
},
131+
[
132+
"test_1.clumped.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
133+
"test_2.clumped.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
134+
]
135+
]
136+
],
46137
"versions_bbmap": [
47138
[
48139
"BBMAP_CLUMPIFY",
@@ -52,10 +143,10 @@
52143
]
53144
}
54145
],
55-
"timestamp": "2026-03-11T13:50:43.591887248",
146+
"timestamp": "2026-06-12T13:45:20.572814339",
56147
"meta": {
57-
"nf-test": "0.9.4",
58-
"nextflow": "25.10.4"
148+
"nf-test": "0.9.5",
149+
"nextflow": "26.04.3"
59150
}
60151
}
61152
}

0 commit comments

Comments
 (0)