-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from nf-core/fix/restructured-nf-tests
Fix/restructured nf tests
- Loading branch information
Showing
53 changed files
with
1,210 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
repository_type: pipeline | ||
lint: | ||
files_unchanged: | ||
- .github/CONTRIBUTING.md | ||
- .github/ISSUE_TEMPLATE/bug_report.yml | ||
- assets/nf-core-fetchngs_logo_light.png | ||
- assets/sendmail_template.txt | ||
- lib/NfcoreTemplate.groovy | ||
- .gitattributes | ||
actions_ci: False | ||
actions_ci: false | ||
multiqc_config: false | ||
nextflow_config: | ||
- "params.validationShowHiddenParams" | ||
- "params.validationSchemaIgnoreParams" | ||
schema_params: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
params { | ||
// Base directory for test data | ||
test_data_base = "https://raw.githubusercontent.com/nf-core/test-datasets/fetchngs" | ||
|
||
merge_samplesheet_ids = [ "DRX024467_DRR026872", "SRX11047067_SRR14709033", "SRX9504942_SRR13055517", "DRX026011_DRR028935", "SRX17709227_SRR21711856", "SRX9504942_SRR13055518", "ERX1188904_ERR1109373", "SRX17709228_SRR21711855", "SRX9504942_SRR13055519", "ERX1234253_ERR1160846", "SRX6725035_SRR9984183", "SRX9504942_SRR13055520", "SRX10940790_SRR14593545", "SRX9315476_SRR12848126", "SRX9626017_SRR13191702" ] | ||
|
||
def merge_samplesheet_url = "${params.test_data_base}/modules/local/sra_merge_samplesheet/samplesheets/" | ||
def merge_mappings_url = "${params.test_data_base}/modules/local/sra_merge_samplesheet/mappings/" | ||
def merge_samplesheet_urls = [] | ||
def merge_mappings_urls = [] | ||
|
||
merge_samplesheet_ids.each { id -> | ||
merge_samplesheet_urls += "${merge_samplesheet_url}${id}.samplesheet.csv" | ||
merge_mappings_urls += "${merge_mappings_url}/${id}.mappings.csv" | ||
} | ||
|
||
fastq_ftp_ids = ["SRR13191702"] | ||
def fastq_ftp_url = "ftp.sra.ebi.ac.uk/vol1/fastq/SRR131/002/SRR13191702/" | ||
def fastq_ftp_urls = [] | ||
|
||
fastq_ftp_ids.each { id -> | ||
fastq_ftp_urls += "${fastq_ftp_url}${id}_1.fastq.gz" | ||
fastq_ftp_urls += "${fastq_ftp_url}${id}_2.fastq.gz" | ||
} | ||
|
||
test_data { | ||
'modules_local' { | ||
multiqc_mappings_config = "${params.test_data_base}/modules/local/multiqc_mappings_config/SRX9626017_SRR13191702.mappings.csv" | ||
sra_merge_samplesheet_samplesheets = merge_samplesheet_urls | ||
sra_merge_samplesheet_mappings = merge_mappings_urls | ||
sra_to_samplesheet = "${params.test_data_base}/modules/local/sra_to_samplesheet/SRX9626017_SRR13191702.mappings.csv" | ||
sra_fastq_ftp = fastq_ftp_urls | ||
sra_runinfo_to_ftp = "${params.test_data_base}/modules/local/sra_runinfo_to_ftp/SRR13191702.runinfo.tsv" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Helper functions for pipeline tests | ||
|
||
class NftestUtils { | ||
|
||
// Function to remove Nextflow version from software_versions.yml | ||
public static String removeNextflowVersion(outputDir) { | ||
def softwareVersions = path("$outputDir/pipeline_info/software_versions.yml").yaml | ||
if (softwareVersions.containsKey("Workflow")) { | ||
softwareVersions.Workflow.remove("Nextflow") | ||
} | ||
return softwareVersions | ||
} | ||
|
||
// Function to filter lines from a file and return a new file | ||
public static File filterLines(String inFilePath, int linesToSkip) { | ||
if (linesToSkip >= 0) { | ||
File inputFile = new File(inFilePath) | ||
File outputFile = new File(inFilePath + ".filtered") | ||
def lineCount = 0 | ||
inputFile.eachLine { line -> | ||
lineCount++ | ||
if (lineCount > linesToSkip) { | ||
outputFile.append(line + '\n') | ||
} | ||
} | ||
return outputFile | ||
} else { | ||
File inputFile = new File(inFilePath) | ||
File outputFile = new File(inFilePath + ".filtered") | ||
def lines = inputFile.readLines() | ||
def totalLines = lines.size() | ||
lines.take(totalLines + linesToSkip).each { line -> | ||
outputFile.append(line + '\n') | ||
} | ||
return outputFile | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
modules/local/multiqc_mappings_config/multiqc_mappings_config.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
nextflow_process { | ||
|
||
name "Test Process MULTIQC_MAPPINGS_CONFIG" | ||
script "modules/local/multiqc_mappings_config/multiqc_mappings_config.nf" | ||
process "MULTIQC_MAPPINGS_CONFIG" | ||
tag "multiqc_mappings_config" | ||
tag "modules_local" | ||
|
||
test("SRX9626017_SRR13191702") { | ||
|
||
when { | ||
params { | ||
outdir = "$outputDir" | ||
} | ||
process { | ||
""" | ||
input[0] = file(params.test_data['modules_local']['multiqc_mappings_config'], checkIfExists: true) | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() }, | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
modules/local/multiqc_mappings_config/multiqc_mappings_config.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"SRX9626017_SRR13191702": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
"multiqc_config.yml:md5,7f3cb10fff83ba9eb3e8fa6862d1290a", | ||
"versions.yml:md5,dd4c66f0551d15510b36bb2e2b2fdd73" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,dd4c66f0551d15510b36bb2e2b2fdd73" | ||
], | ||
"versions": [ | ||
"versions.yml:md5,dd4c66f0551d15510b36bb2e2b2fdd73" | ||
], | ||
"yml": [ | ||
[ | ||
"multiqc_config.yml:md5,7f3cb10fff83ba9eb3e8fa6862d1290a", | ||
"versions.yml:md5,dd4c66f0551d15510b36bb2e2b2fdd73" | ||
] | ||
] | ||
} | ||
], | ||
"timestamp": "2023-07-05T15:01:18+0000" | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
nextflow_process { | ||
|
||
name "Test Process SRA_FASTQ_FTP" | ||
script "modules/local/sra_fastq_ftp/sra_fastq_ftp.nf" | ||
process "SRA_FASTQ_FTP" | ||
tag "sra_fastq_ftp" | ||
tag "modules_local" | ||
|
||
test("SRX9626017_SRR13191702") { | ||
|
||
when { | ||
params { | ||
outdir = "$outputDir" | ||
} | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'SRX9626017_SRR13191702', single_end:false, md5_1: '89c5be920021a035084d8aeb74f32df7', md5_2: '56271be38a80db78ef3bdfc5d9909b98' ], // meta map | ||
params.test_data['modules_local']['sra_fastq_ftp'] | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() }, | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{ | ||
"SRX9626017_SRR13191702": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz:md5,89c5be920021a035084d8aeb74f32df7", | ||
"SRX9626017_SRR13191702_2.fastq.gz:md5,56271be38a80db78ef3bdfc5d9909b98" | ||
] | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz.md5:md5,055a6916ec9ee478e453d50651f87997", | ||
"SRX9626017_SRR13191702_2.fastq.gz.md5:md5,c30ac785f8d80ec563fabf604d8bf945" | ||
] | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,6b9d69dea1c1305f74a65197ee871f1b" | ||
], | ||
"fastq": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz:md5,89c5be920021a035084d8aeb74f32df7", | ||
"SRX9626017_SRR13191702_2.fastq.gz:md5,56271be38a80db78ef3bdfc5d9909b98" | ||
] | ||
] | ||
], | ||
"md5": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz.md5:md5,055a6916ec9ee478e453d50651f87997", | ||
"SRX9626017_SRR13191702_2.fastq.gz.md5:md5,c30ac785f8d80ec563fabf604d8bf945" | ||
] | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,6b9d69dea1c1305f74a65197ee871f1b" | ||
] | ||
} | ||
], | ||
"timestamp": "2023-08-06T23:31:57+0000" | ||
}, | ||
"Should run without failures": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz:md5,89c5be920021a035084d8aeb74f32df7", | ||
"SRX9626017_SRR13191702_2.fastq.gz:md5,56271be38a80db78ef3bdfc5d9909b98" | ||
] | ||
] | ||
], | ||
"1": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz.md5:md5,055a6916ec9ee478e453d50651f87997", | ||
"SRX9626017_SRR13191702_2.fastq.gz.md5:md5,c30ac785f8d80ec563fabf604d8bf945" | ||
] | ||
] | ||
], | ||
"2": [ | ||
"versions.yml:md5,6b9d69dea1c1305f74a65197ee871f1b" | ||
], | ||
"fastq": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz:md5,89c5be920021a035084d8aeb74f32df7", | ||
"SRX9626017_SRR13191702_2.fastq.gz:md5,56271be38a80db78ef3bdfc5d9909b98" | ||
] | ||
] | ||
], | ||
"md5": [ | ||
[ | ||
{ | ||
"id": "SRX9626017_SRR13191702", | ||
"single_end": false, | ||
"md5_1": "89c5be920021a035084d8aeb74f32df7", | ||
"md5_2": "56271be38a80db78ef3bdfc5d9909b98" | ||
}, | ||
[ | ||
"SRX9626017_SRR13191702_1.fastq.gz.md5:md5,055a6916ec9ee478e453d50651f87997", | ||
"SRX9626017_SRR13191702_2.fastq.gz.md5:md5,c30ac785f8d80ec563fabf604d8bf945" | ||
] | ||
] | ||
], | ||
"versions": [ | ||
"versions.yml:md5,6b9d69dea1c1305f74a65197ee871f1b" | ||
] | ||
} | ||
], | ||
"timestamp": "2023-08-06T23:31:57+0000" | ||
} | ||
} |
File renamed without changes.
Oops, something went wrong.