-
Notifications
You must be signed in to change notification settings - Fork 426
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 #1678 from maxulysse/nft-utils-0-0-3
Migrate pytest aligner and pipeline default tests to nf-test
- Loading branch information
Showing
28 changed files
with
1,280 additions
and
802 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
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,10 +1,19 @@ | ||
config { | ||
// location for all nf-tests | ||
testsDir "." | ||
workDir ".nf-test" | ||
|
||
// nf-test directory including temporary files for each test | ||
workDir System.getenv("NFT_WORKDIR") ?: ".nf-test" | ||
|
||
// location of an optional nextflow.config file specific for executing tests | ||
configFile "conf/test.config" | ||
|
||
// run all test with defined profile(s) from the main nextflow.config | ||
profile "test" | ||
|
||
// Include plugins | ||
plugins { | ||
load "[email protected]" | ||
load "[email protected]" | ||
load "[email protected]" | ||
} | ||
} |
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,81 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test pipeline" | ||
script "../main.nf" | ||
tag "pipeline" | ||
tag "pipeline_sarek" | ||
|
||
test("Run with profile test | --aligner bwa-mem --save_reference | skip QC/recal/md") { | ||
|
||
when { | ||
params { | ||
aligner = 'bwa-mem' | ||
modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' | ||
outdir = "$outputDir" | ||
save_reference = true | ||
skip_tools = 'baserecalibrator,fastqc,markduplicates,mosdepth,multiqc,samtools' | ||
tools = '' | ||
} | ||
} | ||
|
||
then { | ||
// stable_name: All files + folders in ${params.outdir}/ with a stable name | ||
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) | ||
// stable_path: All files in ${params.outdir}/ with stable content | ||
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') | ||
// cram_files: All cram files | ||
def cram_files = getAllFilesFromDir(params.outdir, include: ['**/*.cram']) | ||
def fasta = params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta' | ||
assertAll( | ||
{ assert workflow.success}, | ||
{ assert snapshot( | ||
// Number of successful tasks | ||
workflow.trace.succeeded().size(), | ||
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions | ||
removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), | ||
// All stable path name, with a relative path | ||
stable_name, | ||
// All files with stable contents | ||
stable_path, | ||
// All cram files | ||
cram_files.collect{ file -> [ file.getName(), cram(file.toString(), fasta).getReadsMD5() ] } | ||
).match() } | ||
) | ||
} | ||
} | ||
|
||
test("Run with profile test | --aligner bwa-mem --save_reference --build_only_index") { | ||
|
||
when { | ||
params { | ||
aligner = 'bwa-mem' | ||
build_only_index = true | ||
input = false | ||
outdir = "$outputDir" | ||
save_reference = true | ||
skip_tools = 'multiqc' | ||
tools = '' | ||
} | ||
} | ||
|
||
then { | ||
// stable_name: All files + folders in ${params.outdir}/ with a stable name | ||
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) | ||
// stable_path: All files in ${params.outdir}/ with stable content | ||
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') | ||
assertAll( | ||
{ assert workflow.success}, | ||
{ assert snapshot( | ||
// Number of successful tasks | ||
workflow.trace.succeeded().size(), | ||
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions | ||
removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), | ||
// All stable path name, with a relative path | ||
stable_name, | ||
// All files with stable contents | ||
stable_path | ||
).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,113 @@ | ||
{ | ||
"Run with profile test | --aligner bwa-mem --save_reference | skip QC/recal/md": { | ||
"content": [ | ||
10, | ||
{ | ||
"BAM_TO_CRAM_MAPPING": { | ||
"samtools": 1.21 | ||
}, | ||
"BWAMEM1_MEM": { | ||
"bwa": "0.7.18-r1243-dirty", | ||
"samtools": 1.2 | ||
}, | ||
"INDEX_MERGE_BAM": { | ||
"samtools": 1.21 | ||
}, | ||
"MERGE_BAM": { | ||
"samtools": 1.21 | ||
}, | ||
"Workflow": { | ||
"nf-core/sarek": "v3.5.0dev" | ||
} | ||
}, | ||
[ | ||
"csv", | ||
"csv/mapped.csv", | ||
"pipeline_info", | ||
"pipeline_info/nf_core_sarek_software_mqc_versions.yml", | ||
"preprocessing", | ||
"preprocessing/mapped", | ||
"preprocessing/mapped/test", | ||
"preprocessing/mapped/test/test.sorted.cram", | ||
"preprocessing/mapped/test/test.sorted.cram.crai", | ||
"reference", | ||
"reference/bwa", | ||
"reference/bwa/genome.amb", | ||
"reference/bwa/genome.ann", | ||
"reference/bwa/genome.bwt", | ||
"reference/bwa/genome.pac", | ||
"reference/bwa/genome.sa", | ||
"reference/intervals", | ||
"reference/intervals/chr22_1-40001.bed", | ||
"reference/intervals/chr22_1-40001.bed.gz", | ||
"reference/intervals/genome.bed", | ||
"reference/intervals/genome.bed.gz" | ||
], | ||
[ | ||
"genome.amb:md5,1891c1de381b3a96d4e72f590fde20c1", | ||
"genome.ann:md5,2df4aa2d7580639fa0fcdbcad5e2e969", | ||
"genome.bwt:md5,815eded87e4cb6b0f1daab5c4d6e30af", | ||
"genome.pac:md5,8569fbdb2c98c6fb16dfa73d8eacb070", | ||
"genome.sa:md5,e7cff62b919448a3a3d0fe4aaf427594", | ||
"chr22_1-40001.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7", | ||
"chr22_1-40001.bed.gz:md5,87a15eb9c2ff20ccd5cd8735a28708f7", | ||
"genome.bed:md5,a87dc7d20ebca626f65cc16ff6c97a3e", | ||
"genome.bed.gz:md5,a87dc7d20ebca626f65cc16ff6c97a3e" | ||
], | ||
[ | ||
[ | ||
"test.sorted.cram", | ||
"5534c350547fd253f0f2b9450362bed" | ||
] | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.09.0" | ||
}, | ||
"timestamp": "2024-10-08T11:22:13.394114" | ||
}, | ||
"Run with profile test | --aligner bwa-mem --save_reference --build_only_index": { | ||
"content": [ | ||
5, | ||
{ | ||
"Workflow": { | ||
"nf-core/sarek": "v3.5.0dev" | ||
} | ||
}, | ||
[ | ||
"csv", | ||
"pipeline_info", | ||
"pipeline_info/nf_core_sarek_software_mqc_versions.yml", | ||
"reference", | ||
"reference/bwa", | ||
"reference/bwa/genome.amb", | ||
"reference/bwa/genome.ann", | ||
"reference/bwa/genome.bwt", | ||
"reference/bwa/genome.pac", | ||
"reference/bwa/genome.sa", | ||
"reference/intervals", | ||
"reference/intervals/chr22_1-40001.bed", | ||
"reference/intervals/chr22_1-40001.bed.gz", | ||
"reference/intervals/genome.bed", | ||
"reference/intervals/genome.bed.gz" | ||
], | ||
[ | ||
"genome.amb:md5,1891c1de381b3a96d4e72f590fde20c1", | ||
"genome.ann:md5,2df4aa2d7580639fa0fcdbcad5e2e969", | ||
"genome.bwt:md5,815eded87e4cb6b0f1daab5c4d6e30af", | ||
"genome.pac:md5,8569fbdb2c98c6fb16dfa73d8eacb070", | ||
"genome.sa:md5,e7cff62b919448a3a3d0fe4aaf427594", | ||
"chr22_1-40001.bed:md5,87a15eb9c2ff20ccd5cd8735a28708f7", | ||
"chr22_1-40001.bed.gz:md5,87a15eb9c2ff20ccd5cd8735a28708f7", | ||
"genome.bed:md5,a87dc7d20ebca626f65cc16ff6c97a3e", | ||
"genome.bed.gz:md5,a87dc7d20ebca626f65cc16ff6c97a3e" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.9.0", | ||
"nextflow": "24.09.0" | ||
}, | ||
"timestamp": "2024-10-08T11:23:05.203586" | ||
} | ||
} |
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,81 @@ | ||
nextflow_pipeline { | ||
|
||
name "Test pipeline" | ||
script "../main.nf" | ||
tag "pipeline" | ||
tag "pipeline_sarek" | ||
|
||
test("Run with profile test | --aligner bwa-mem2 --save_reference | skip QC/recal/md") { | ||
|
||
when { | ||
params { | ||
aligner = 'bwa-mem2' | ||
modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/' | ||
outdir = "$outputDir" | ||
save_reference = true | ||
skip_tools = 'baserecalibrator,fastqc,markduplicates,mosdepth,multiqc,samtools' | ||
tools = '' | ||
} | ||
} | ||
|
||
then { | ||
// stable_name: All files + folders in ${params.outdir}/ with a stable name | ||
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) | ||
// stable_path: All files in ${params.outdir}/ with stable content | ||
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') | ||
// cram_files: All cram files | ||
def cram_files = getAllFilesFromDir(params.outdir, include: ['**/*.cram']) | ||
def fasta = params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta' | ||
assertAll( | ||
{ assert workflow.success}, | ||
{ assert snapshot( | ||
// Number of successful tasks | ||
workflow.trace.succeeded().size(), | ||
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions | ||
removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), | ||
// All stable path name, with a relative path | ||
stable_name, | ||
// All files with stable contents | ||
stable_path, | ||
// All cram files | ||
cram_files.collect{ file -> [ file.getName(), cram(file.toString(), fasta).getReadsMD5() ] } | ||
).match() } | ||
) | ||
} | ||
} | ||
|
||
test("Run with profile test | --aligner bwa-mem2 --save_reference --build_only_index") { | ||
|
||
when { | ||
params { | ||
aligner = 'bwa-mem2' | ||
build_only_index = true | ||
input = false | ||
outdir = "$outputDir" | ||
save_reference = true | ||
skip_tools = 'multiqc' | ||
tools = '' | ||
} | ||
} | ||
|
||
then { | ||
// stable_name: All files + folders in ${params.outdir}/ with a stable name | ||
def stable_name = getAllFilesFromDir(params.outdir, relative: true, includeDir: true, ignore: ['pipeline_info/*.{html,json,txt}']) | ||
// stable_path: All files in ${params.outdir}/ with stable content | ||
def stable_path = getAllFilesFromDir(params.outdir, ignoreFile: 'tests/.nftignore') | ||
assertAll( | ||
{ assert workflow.success}, | ||
{ assert snapshot( | ||
// Number of successful tasks | ||
workflow.trace.succeeded().size(), | ||
// pipeline versions.yml file for multiqc from which Nextflow version is removed because we tests pipelines on multiple Nextflow versions | ||
removeNextflowVersion("$outputDir/pipeline_info/nf_core_sarek_software_mqc_versions.yml"), | ||
// All stable path name, with a relative path | ||
stable_name, | ||
// All files with stable contents | ||
stable_path | ||
).match() } | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.