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

Nf test #285

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ eggnog
kofam
kofamscan
eukulele
.nf-test.log
nf-test
.nf-test*
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- [#285](<[https://github.com/nf-core/metatdenovo/pull/285](https://github.com/nf-core/metatdenovo/pull/285)>) added nf-test for default settings.
- [#280](<[https://github.com/nf-core/metatdenovo/issues/280](https://github.com/nf-core/metatdenovo/issues/280)>) - Added minid option to bbmap_align module. Now the threshold for mapping a read to a contig is an identity of 0.9. The previous version of nf-core/metatdenovo used the default for BBMap, 0.76. This version might hence give slightly different results than the previous.
- [#271](<[https://github.com/nf-core/metatdenovo/issues/271](https://github.com/nf-core/metatdenovo/issues/271)>) - Added flavor to SPADES modules

Expand Down
10 changes: 10 additions & 0 deletions nf-test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
config {
// Location of nf-tests
testsDir "."

// nf-test directory used to create temporary files for each test
workDir System.getenv("NFT_WORKDIR") ?: ".nf-test"

// Location of an optional nextflow.config file specific for executing pipeline tests
configFile "tests/nextflow.config"
}
39 changes: 39 additions & 0 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
nextflow_pipeline {
name "Test pipeline"
script "../main.nf"
tag "PIPELINE"

test("Run with profile test") {

when {
params {
outdir = "$outputDir"
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/metatdenovo/samplesheet/samplesheet.csv'
skip_eukulele = true
skip_eggnog = true
skip_kofamscan = true
}
}

then {
assert workflow.success

assertAll(
{ assert new File("$outputDir/trimgalore/SAMPLE1_PE_1.fastq.gz_trimming_report.txt").exists() },
{ assert new File("$outputDir/trimgalore/fastqc/SAMPLE1_PE_1_val_1_fastqc.html").exists() },
{ assert new File("$outputDir/megahit/megahit_out/megahit_assembly.log").exists() },
{ assert new File("$outputDir/prodigal/megahit.prodigal.gff.gz").exists() },
{ assert new File("$outputDir/samtools/SAMPLE1_PE.sorted.bam.bai").exists() },
{ assert new File("$outputDir/bbmap/logs/SAMPLE1_PE.bbmap.log").exists() },
{ assert new File("$outputDir/featurecounts/SAMPLE1_PE.featureCounts.txt.summary").exists() },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.counts.tsv.gz").exists() },
{ assert new File("$outputDir/summary_tables/megahit.prodigal.overall_stats.tsv.gz").exists() },
{ assert new File("$outputDir/multiqc/multiqc_report.html").exists() },
{ assert new File("$outputDir/pipeline_info/nf_core_metatdenovo_software_mqc_versions.yml").exists() }
{ assert snapshot(
path("${params.outdir}/trimgalore/SAMPLE1_PE_1.fastq.gz_trimming_report.txt"))
.match("output_files")
}
)
}
}
12 changes: 12 additions & 0 deletions tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"output_files": {
"content": [
"SAMPLE1_PE_1.fastq.gz_trimming_report.txt:md5,9c4b1b4309830cba58fc4a298ab4431e"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-22T11:15:50.396953549"
}
}
33 changes: 33 additions & 0 deletions tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
========================================================================================
Nextflow config file for running tests
========================================================================================
*/

params {
// Base directory for nf-core/modules test data
modules_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/modules/'

// Base directory for nf-core/rnaseq test data
pipelines_testdata_base_path = 's3://ngi-igenomes/testdata/nf-core/pipelines/rnaseq/3.15/'
}

// Impose sensible resource limits for testing
process {
withName: '.*' {
cpus = 4
memory = 4.GB
time = 2.h
}
}

// Impose same minimum Nextflow version as the pipeline for testing
manifest {
nextflowVersion = '!>=23.04.0'
}

// Disable all Nextflow reporting options
timeline { enabled = false }
report { enabled = false }
trace { enabled = false }
dag { enabled = false }
Loading