Skip to content

Commit 3afb111

Browse files
authored
Merge pull request #3815 from mashehu/add-example-capture-to-modules-test
2 parents 97371c3 + 435164d commit 3afb111

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
- Support modules with `exec:` blocks ([#3633](https://github.com/nf-core/tools/pull/3633))
3232
- feat: nf-core modules bump-version supports specifying the toolkit ([#3608](https://github.com/nf-core/tools/pull/3608))
3333
- Override example keywords in modules test ([#3801](https://github.com/nf-core/tools/pull/3801))
34+
- update test assertions in modules template to current recommendations and remove `single_end` from example meta value ([#3815](https://github.com/nf-core/tools/pull/3815))
3435

3536
### Subworkflows
3637

nf_core/module-template/tests/main.nf.test.j2

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ nextflow_process {
2727
// TODO nf-core: define inputs of the process here. Example:
2828
{% if has_meta %}
2929
input[0] = [
30-
[ id:'test', single_end:false ], // meta map
30+
[ id:'test' ],
3131
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
3232
]
3333
{%- else %}
@@ -38,9 +38,12 @@ nextflow_process {
3838
}
3939

4040
then {
41+
assert process.success
4142
assertAll(
42-
{ assert process.success },
43-
{ assert snapshot(process.out).match() }
43+
{ assert snapshot(
44+
process.out,
45+
path(process.out.versions[0]).yaml
46+
).match() }
4447
//TODO nf-core: Add all required assertions to verify the test output.
4548
// See https://nf-co.re/docs/contributing/tutorials/nf-test_assertions for more information and examples.
4649
)
@@ -59,7 +62,7 @@ nextflow_process {
5962
// TODO nf-core: define inputs of the process here. Example:
6063
{% if has_meta %}
6164
input[0] = [
62-
[ id:'test', single_end:false ], // meta map
65+
[ id:'test' ],
6366
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true),
6467
]
6568
{%- else %}
@@ -70,10 +73,12 @@ nextflow_process {
7073
}
7174

7275
then {
76+
assert process.success
7377
assertAll(
74-
{ assert process.success },
75-
{ assert snapshot(process.out).match() }
76-
//TODO nf-core: Add all required assertions to verify the test output.
78+
{ assert snapshot(
79+
process.out,
80+
path(process.out.versions[0]).yaml
81+
).match() }
7782
)
7883
}
7984

nf_core/subworkflow-template/tests/main.nf.test.j2

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ nextflow_workflow {
3333
"""
3434
}
3535
}
36-
3736
then {
37+
assert workflow.success
3838
assertAll(
39-
{ assert workflow.success},
40-
{ assert snapshot(workflow.out).match()}
41-
//TODO nf-core: Add all required assertions to verify the test output.
39+
{ assert snapshot(
40+
workflow.out
41+
//TODO nf-core: Add all required assertions to verify the test output.
42+
).match() }
4243
)
4344
}
4445
}

0 commit comments

Comments
 (0)