Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fq/generate #6610

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions modules/nf-core/fq/generate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,16 @@ process FQ_GENERATE {
fq: \$(echo \$(fq generate --version | sed 's/fq-generate //g'))
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo | gzip > ${prefix}_R1.fastq.gz
echo | gzip > ${prefix}_R2.fastq.gz

cat <<-END_VERSIONS > versions.yml
"${task.process}":
fq: \$(echo \$(fq generate --version | sed 's/fq-generate //g'))
END_VERSIONS
"""
}
23 changes: 20 additions & 3 deletions modules/nf-core/fq/generate/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,28 @@ nextflow_process {
tag "fq"
tag "fq/generate"

test("test_fq_lint_fail") {
test("test fq") {
config "./nextflow.config"
when {
params {
outdir = "$outputDir"
process {
"""
input[0] = Channel.of( [ id:'test', single_end:false ] )
"""
}
}

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

}

test("test fq -stub") {
options "-stub"
when {
process {
"""
input[0] = Channel.of( [ id:'test', single_end:false ] )
Expand All @@ -30,4 +46,5 @@ nextflow_process {
}

}

}
57 changes: 51 additions & 6 deletions modules/nf-core/fq/generate/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"test_fq_lint_fail": {
"test fq -stub": {
"content": [
{
"0": [
Expand All @@ -9,8 +9,8 @@
"single_end": false
},
[
"test_R1.fastq.gz:md5,1d262f7028e65d291c4a46f890f539e1",
"test_R2.fastq.gz:md5,d7bd728bb013edced318e2a797ad60b3"
"test_R1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_R2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
Expand All @@ -24,8 +24,8 @@
"single_end": false
},
[
"test_R1.fastq.gz:md5,1d262f7028e65d291c4a46f890f539e1",
"test_R2.fastq.gz:md5,d7bd728bb013edced318e2a797ad60b3"
"test_R1.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_R2.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
Expand All @@ -34,6 +34,51 @@
]
}
],
"timestamp": "2023-10-17T11:27:57.943374"
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-06T16:03:12.733228308"
},
"test fq": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
[
"test_R1.fastq.gz:md5,3acdc5cb66c65a6fb1e8a87c37dec288",
"test_R2.fastq.gz:md5,026a0d0711dc3cd581ab26c5b1757eee"
]
]
],
"1": [
"versions.yml:md5,def2d5900b648a4fc802b237e985efb7"
],
"fastq": [
[
{
"id": "test",
"single_end": false
},
[
"test_R1.fastq.gz:md5,3acdc5cb66c65a6fb1e8a87c37dec288",
"test_R2.fastq.gz:md5,026a0d0711dc3cd581ab26c5b1757eee"
]
]
],
"versions": [
"versions.yml:md5,def2d5900b648a4fc802b237e985efb7"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-06T16:03:01.858857277"
}
}
5 changes: 1 addition & 4 deletions modules/nf-core/fq/generate/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
process {

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

withName: FQ_GENERATE {
ext.args = '-s 123'
}
}
}
Loading