Skip to content

Commit

Permalink
Added nf-test for untarfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp committed Aug 28, 2024
1 parent 55d2a1a commit 3815670
Show file tree
Hide file tree
Showing 6 changed files with 460 additions and 71 deletions.
104 changes: 104 additions & 0 deletions modules/nf-core/untarfiles/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@

nextflow_process {

name "Test Process UNTARFILES"
script "../main.nf"
process "UNTARFILES"

tag "modules"
tag "modules_nfcore"
tag "untarfiles"

test("test-untarfiles") {

when {
process {
"""
input[0] = [
[id: 'test'],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/db/kraken2.tar.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("test-untarfiles-different-output-path") {

when {
process {
"""
input[0] = [
[id: 'test'],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bcl/flowcell.tar.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.files[0][1].collect { file(it).name }.toSorted(),
process.out.versions
).match()
}
)
}
}

test("test-untarfiles-onlyfiles") {

when {
process {
"""
input[0] = [
[id: 'test'],
file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("test-untarfiles-onlyfiles-stub") {
options '-stub'
when {
process {
"""
input[0] = [
[id: 'test'],
file(params.modules_testdata_base_path + 'generic/tar/hello.tar.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
Loading

0 comments on commit 3815670

Please sign in to comment.