Skip to content

Commit

Permalink
attempt to fix tests: 1
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse committed Oct 15, 2024
1 parent 0987c8c commit 473d1a2
Show file tree
Hide file tree
Showing 18 changed files with 2,426 additions and 224 deletions.
27 changes: 5 additions & 22 deletions workflows/sra/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ nextflow_workflow {
test("Parameters: default") {

when {
params {
outdir = "$outputDir"
}
workflow {
"""
input[0] = Channel.from("DRX026011", "ERX1234253", "SRX6725035")
Expand All @@ -23,29 +26,9 @@ nextflow_workflow {
}

then {
assert workflow.success

assertAll(
{
with(workflow.out.samplesheet) {
assert path(get(0)).readLines().size() == 4
assert path(get(0)).readLines()*.split(',')[0].take(4) == ['"sample"', '"fastq_1"', '"fastq_2"', '"run_accession"']
assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"']
assert path(get(0)).text.contains('Illumina HiSeq 2500')
}
},
{
with(workflow.out.mappings) {
assert path(get(0)).readLines().size() == 4
assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"']
assert path(get(0)).text.contains('Illumina HiSeq 2500')
}
},
{
with(workflow.out.sample_mappings) {
assert path(get(0)[0]).md5 == "1ac06bb95b503703430e74660bbdd768"
}
}
{ assert workflow.success},
{ assert snapshot(workflow.out).match() }
)
}
}
Expand Down
281 changes: 281 additions & 0 deletions workflows/sra/tests/main.nf.test.snap

Large diffs are not rendered by default.

35 changes: 8 additions & 27 deletions workflows/sra/tests/sra_custom_ena_metadata_fields.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,23 @@ nextflow_workflow {
test("Parameters: --nf_core_pipeline rnaseq --ena_metadata_fields ... --sample_mapping_fields ...") {

when {
params {
outdir = "$outputDir"
ena_metadata_fields = "run_accession,experiment_accession,library_layout,fastq_ftp,fastq_md5"
nf_core_pipeline = "rnaseq"
sample_mapping_fields = "run_accession,library_layout"
}
workflow {
"""
input[0] = Channel.from("DRX026011", "ERX1234253", "SRX6725035")
"""
}
params {
nf_core_pipeline = "rnaseq"
ena_metadata_fields = "run_accession,experiment_accession,library_layout,fastq_ftp,fastq_md5"
sample_mapping_fields = "run_accession,library_layout"
}
}

then {
assert workflow.success

assertAll(
{
with(workflow.out.samplesheet) {
assert path(get(0)).readLines().size() == 4
assert path(get(0)).readLines()*.split(',')[0].take(5) == ['"sample"', '"fastq_1"', '"fastq_2"', '"strandedness"' , '"run_accession"']
assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"']
assert path(get(0)).text.contains('SINGLE')
}
},
{
with(workflow.out.mappings) {
assert path(get(0)).readLines().size() == 4
assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"']
assert path(get(0)).text.contains('SINGLE')
}
},
{
with(workflow.out.sample_mappings) {
assert path(get(0)[0]).md5 == "3b70bc9658eab4ba2f4ec98cb749ac9d"
}
}
{ assert workflow.success},
{ assert snapshot(workflow.out).match() }
)
}
}
Expand Down
125 changes: 125 additions & 0 deletions workflows/sra/tests/sra_custom_ena_metadata_fields.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"Parameters: --nf_core_pipeline rnaseq --ena_metadata_fields ... --sample_mapping_fields ...": {
"content": [
{
"0": [
"samplesheet.csv:md5,5f79ecf678ce5af375cf8749b56da139"
],
"1": [
"id_mappings.csv:md5,7345715e7db0a160efb8dd3be9ce58ac"
],
"2": [
"multiqc_config.yml:md5,3b70bc9658eab4ba2f4ec98cb749ac9d"
],
"3": [
{
"experiment_accession": "DRX026011",
"fastq_1": "DRX026011_DRR028935_1.fastq.gz:md5,f9b4a5d25aa7d6ab4050dbe0764eb04d",
"fastq_2": "DRX026011_DRR028935_2.fastq.gz:md5,dc0d2e1fc46f4d4581a477f87ec3ff15",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/DRR028/DRR028935/DRR028935_1.fastq.gz;ftp.sra.ebi.ac.uk/vol1/fastq/DRR028/DRR028935/DRR028935_2.fastq.gz",
"fastq_md5": "cc01df82a9354bb6b3be93483b20c35a;941c9998d746416dad53c94c480ddf30",
"id": "DRX026011_DRR028935",
"library_layout": "PAIRED",
"md5_1": "cc01df82a9354bb6b3be93483b20c35a",
"md5_2": "941c9998d746416dad53c94c480ddf30",
"run_accession": "DRR028935",
"single_end": false
},
{
"experiment_accession": "ERX1234253",
"fastq_1": "ERX1234253_ERR1160846.fastq.gz:md5,b1de59f829fbd2d60a1ed4bc3da55709",
"fastq_2": "",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR116/006/ERR1160846/ERR1160846.fastq.gz",
"fastq_md5": "5924f20ef547ebdfed7cad795bbab6e6",
"id": "ERX1234253_ERR1160846",
"library_layout": "SINGLE",
"md5_1": "5924f20ef547ebdfed7cad795bbab6e6",
"md5_2": "",
"run_accession": "ERR1160846",
"single_end": true
},
{
"experiment_accession": "SRX6725035",
"fastq_1": "SRX6725035_SRR9984183.fastq.gz:md5,c9b4c2c4abf19da7082caf442fdefea7",
"fastq_2": "",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/SRR998/003/SRR9984183/SRR9984183.fastq.gz",
"fastq_md5": "0b512d2dc31685983456bd56fd836544",
"id": "SRX6725035_SRR9984183",
"library_layout": "SINGLE",
"md5_1": "0b512d2dc31685983456bd56fd836544",
"md5_2": "",
"run_accession": "SRR9984183",
"single_end": true
}
],
"4": [
"versions.yml:md5,1496d1cbc9041e07ab8a0c25f0b054d9",
"versions.yml:md5,9b17045ca8bdc272cb3f9d349a81d206",
"versions.yml:md5,b52279f7d6b891a6523d9321f3f85b47",
"versions.yml:md5,c19fc0f920e57875881761cc944a46d7"
],
"mappings": [
"id_mappings.csv:md5,7345715e7db0a160efb8dd3be9ce58ac"
],
"sample_mappings": [
"multiqc_config.yml:md5,3b70bc9658eab4ba2f4ec98cb749ac9d"
],
"samplesheet": [
"samplesheet.csv:md5,5f79ecf678ce5af375cf8749b56da139"
],
"sra_metadata": [
{
"experiment_accession": "DRX026011",
"fastq_1": "DRX026011_DRR028935_1.fastq.gz:md5,f9b4a5d25aa7d6ab4050dbe0764eb04d",
"fastq_2": "DRX026011_DRR028935_2.fastq.gz:md5,dc0d2e1fc46f4d4581a477f87ec3ff15",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/DRR028/DRR028935/DRR028935_1.fastq.gz;ftp.sra.ebi.ac.uk/vol1/fastq/DRR028/DRR028935/DRR028935_2.fastq.gz",
"fastq_md5": "cc01df82a9354bb6b3be93483b20c35a;941c9998d746416dad53c94c480ddf30",
"id": "DRX026011_DRR028935",
"library_layout": "PAIRED",
"md5_1": "cc01df82a9354bb6b3be93483b20c35a",
"md5_2": "941c9998d746416dad53c94c480ddf30",
"run_accession": "DRR028935",
"single_end": false
},
{
"experiment_accession": "ERX1234253",
"fastq_1": "ERX1234253_ERR1160846.fastq.gz:md5,b1de59f829fbd2d60a1ed4bc3da55709",
"fastq_2": "",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/ERR116/006/ERR1160846/ERR1160846.fastq.gz",
"fastq_md5": "5924f20ef547ebdfed7cad795bbab6e6",
"id": "ERX1234253_ERR1160846",
"library_layout": "SINGLE",
"md5_1": "5924f20ef547ebdfed7cad795bbab6e6",
"md5_2": "",
"run_accession": "ERR1160846",
"single_end": true
},
{
"experiment_accession": "SRX6725035",
"fastq_1": "SRX6725035_SRR9984183.fastq.gz:md5,c9b4c2c4abf19da7082caf442fdefea7",
"fastq_2": "",
"fastq_ftp": "ftp.sra.ebi.ac.uk/vol1/fastq/SRR998/003/SRR9984183/SRR9984183.fastq.gz",
"fastq_md5": "0b512d2dc31685983456bd56fd836544",
"id": "SRX6725035_SRR9984183",
"library_layout": "SINGLE",
"md5_1": "0b512d2dc31685983456bd56fd836544",
"md5_2": "",
"run_accession": "SRR9984183",
"single_end": true
}
],
"versions": [
"versions.yml:md5,1496d1cbc9041e07ab8a0c25f0b054d9",
"versions.yml:md5,9b17045ca8bdc272cb3f9d349a81d206",
"versions.yml:md5,b52279f7d6b891a6523d9321f3f85b47",
"versions.yml:md5,c19fc0f920e57875881761cc944a46d7"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.09.2"
},
"timestamp": "2024-10-15T13:03:36.272997"
}
}
31 changes: 6 additions & 25 deletions workflows/sra/tests/sra_download_method_aspera.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,21 @@ nextflow_workflow {
test("Parameters: --download_method aspera") {

when {
params {
outdir = "$outputDir"
download_method = 'aspera'
}
workflow {
"""
input[0] = Channel.from("DRX026011", "ERX1234253", "SRX6725035")
"""
}
params {
download_method = 'aspera'
}
}

then {
assert workflow.success

assertAll(
{
with(workflow.out.samplesheet) {
assert path(get(0)).readLines().size() == 4
assert path(get(0)).readLines()*.split(',')[0].take(4) == ['"sample"', '"fastq_1"', '"fastq_2"', '"run_accession"']
assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"']
assert path(get(0)).text.contains('Illumina HiSeq 2500')
}
},
{
with(workflow.out.mappings) {
assert path(get(0)).readLines().size() == 4
assert path(get(0)).readLines()*.split(',').collect { it[0] } == ['"sample"', '"DRX026011"', '"ERX1234253"', '"SRX6725035"']
assert path(get(0)).text.contains('Illumina HiSeq 2500')
}
},
{
with(workflow.out.sample_mappings) {
assert path(get(0)[0]).md5 == "1ac06bb95b503703430e74660bbdd768"
}
}
{ assert workflow.success},
{ assert snapshot(workflow.out).match() }
)
}
}
Expand Down
Loading

0 comments on commit 473d1a2

Please sign in to comment.