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

Migrate pipeline pytest alignment and annotation tests to nf-test #1708

Merged
merged 11 commits into from
Oct 29, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [1692](https://github.com/nf-core/sarek/pull/1692) - Update ensemblvep
- [1695](https://github.com/nf-core/sarek/pull/1695) - Update all modules
- [1707](https://github.com/nf-core/sarek/pull/1707) - Un-hide parameters and clean up Json schema
- [1708](https://github.com/nf-core/sarek/pull/1708) - Migrate pipeline pytest alignment and annotation tests to nf-test

### Fixed

Expand Down
4 changes: 2 additions & 2 deletions conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ params {
config_profile_description = 'Minimal test dataset to check pipeline function'

// Base directory for nf-core/modules test data
modules_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/modules/'
modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'

// Input data
input = "${projectDir}/tests/csv/3.0/fastq_single.csv"

// small genome on igenomes
igenomes_base = 's3://ngi-igenomes/testdata/nf-core/modules'
igenomes_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'
genome = 'testdata.nf-core.sarek'

// Small reference genome
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"size": 1
},
[
"/ngi-igenomes/testdata/nf-core/modules/genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz",
"/ngi-igenomes/testdata/nf-core/modules/genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz"
"/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz",
"/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz"
]
]
],
Expand All @@ -35,8 +35,8 @@
"size": 1
},
[
"/ngi-igenomes/testdata/nf-core/modules/genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz",
"/ngi-igenomes/testdata/nf-core/modules/genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz"
"/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/fastq/test_1.fastq.gz",
"/nf-core/test-datasets/modules/data/genomics/homo_sapiens/illumina/fastq/test_2.fastq.gz"
]
]
]
Expand All @@ -48,4 +48,4 @@
},
"timestamp": "2024-10-04T10:25:14.620549"
}
}
}
2 changes: 2 additions & 0 deletions tests/.nftignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ reference/dragmap/hash_table_stats.txt
reports/EnsemblVEP/*/*.ann.summary.html
reports/fastqc/**/*_fastqc.{html,zip}
reports/markduplicates/**/*.md.cram.metrics
reports/snpeff/*/*_snpEff.csv
reports/snpeff/*/snpEff_summary.html
variant_calling/**/*.vcf.{gz,gz.tbi}
46 changes: 46 additions & 0 deletions tests/alignment_from_everything.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
nextflow_pipeline {

name "Test pipeline"
script "../main.nf"
tag "pipeline"
tag "pipeline_sarek"
profile "alignment_from_everything"

test("Run with profile test,alignment_from_everything | --save_mapped --save_output_as_bam") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we name this better


when {
params {
modules_testdata_base_path = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'
igenomes_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data'
outdir = "$outputDir"
save_mapped = true
save_output_as_bam = true
}
}

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() }
)
}
}
}
Loading
Loading