Skip to content

Commit

Permalink
Added nf-test for picard/cleansam (#6297)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Pearce <[email protected]>
  • Loading branch information
GallVp and SPPearce authored Aug 26, 2024
1 parent e989cd7 commit adf8be4
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 41 deletions.
4 changes: 2 additions & 2 deletions modules/nf-core/picard/cleansam/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ input:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- sam:
- bam:
type: file
description: BAM file
pattern: "*.{bam}"
Expand All @@ -35,7 +35,7 @@ output:
type: file
description: File containing software versions
pattern: "versions.yml"
- sam:
- bam:
type: file
description: Cleaned BAM file
pattern: "*.{bam}"
Expand Down
40 changes: 40 additions & 0 deletions modules/nf-core/picard/cleansam/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

nextflow_process {

name "Test Process PICARD_CLEANSAM"
script "../main.nf"
process "PICARD_CLEANSAM"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "picard"
tag "picard/cleansam"

test("test-picard-cleansam") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.bam', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
bam(process.out.bam[0][1]).getReadsMD5(),
process.out.versions
).match()
}
)
}
}

}
15 changes: 15 additions & 0 deletions modules/nf-core/picard/cleansam/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"test-picard-cleansam": {
"content": [
"798439cbd7fd81cbcc5078022dc5479d",
[
"versions.yml:md5,f99b648dc3d150a0561094e3a142ee22"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T10:36:05.525364"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

withName: 'PICARD_CLEANSAM'{
ext.prefix = { "${meta.id}.cleaned"}
}
Expand Down
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -926,9 +926,6 @@ peka:
phyloflash:
- modules/nf-core/phyloflash/**
- tests/modules/nf-core/phyloflash/**
picard/cleansam:
- modules/nf-core/picard/cleansam/**
- tests/modules/nf-core/picard/cleansam/**
picard/collectinsertsizemetrics:
- modules/nf-core/picard/collectinsertsizemetrics/**
- tests/modules/nf-core/picard/collectinsertsizemetrics/**
Expand Down
15 changes: 0 additions & 15 deletions tests/modules/nf-core/picard/cleansam/main.nf

This file was deleted.

18 changes: 0 additions & 18 deletions tests/modules/nf-core/picard/cleansam/test.yml

This file was deleted.

0 comments on commit adf8be4

Please sign in to comment.