Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseEspinosa authored Feb 26, 2025
2 parents cdd3ddb + 804110b commit fbd727e
Show file tree
Hide file tree
Showing 37 changed files with 1,985 additions and 849 deletions.
9 changes: 8 additions & 1 deletion modules/nf-core/cat/fastq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ process CAT_FASTQ {
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def readList = reads instanceof List ? reads.collect { it.toString() } : [reads.toString()]
if (meta.single_end) {
Expand All @@ -31,6 +30,8 @@ process CAT_FASTQ {
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
} else {
error("Could not find any FASTQ files to concatenate in the process input")
}
}
else {
Expand All @@ -47,6 +48,8 @@ process CAT_FASTQ {
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
} else {
error("Could not find any FASTQ file pairs to concatenate in the process input")
}
}

Expand All @@ -63,6 +66,8 @@ process CAT_FASTQ {
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
} else {
error("Could not find any FASTQ files to concatenate in the process input")
}
}
else {
Expand All @@ -76,6 +81,8 @@ process CAT_FASTQ {
cat: \$(echo \$(cat --version 2>&1) | sed 's/^.*coreutils) //; s/ .*\$//')
END_VERSIONS
"""
} else {
error("Could not find any FASTQ file pairs to concatenate in the process input")
}
}
}
88 changes: 88 additions & 0 deletions modules/nf-core/cat/fastq/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,92 @@ nextflow_process {
)
}
}

test("test_cat_fastq_single_end_no_files") {

when {
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:true ], // meta map
[]
])
"""
}
}

then {
assertAll(
{ assert process.failed },
{ assert snapshot(process.stdout.find { it.contains("-- Check script") }.split(" -- Check script")[0]).match() }
)
}
}

test("test_cat_fastq_paired_end_no_files") {

when {
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:false ], // meta map
[]
])
"""
}
}

then {
assertAll(
{ assert process.failed },
{ assert snapshot(process.stdout.find { it.contains("-- Check script") }.split(" -- Check script")[0]).match() }
)
}
}

test("test_cat_fastq_single_end_no_files - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:true ], // meta map
[]
])
"""
}
}

then {
assertAll(
{ assert process.failed },
{ assert snapshot(process.stdout.find { it.contains("-- Check script") }.split(" -- Check script")[0]).match() }
)
}
}

test("test_cat_fastq_paired_end_no_files - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:false ], // meta map
[]
])
"""
}
}

then {
assertAll(
{ assert process.failed },
{ assert snapshot(process.stdout.find { it.contains("-- Check script") }.split(" -- Check script")[0]).match() }
)
}
}
}
Loading

0 comments on commit fbd727e

Please sign in to comment.