Skip to content

Commit

Permalink
Merge pull request #285 from danilodileo/nf-test
Browse files Browse the repository at this point in the history
Nf test
  • Loading branch information
danilodileo authored Apr 23, 2024
2 parents b3f2324 + 4098c2c commit 0130295
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
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"
}
35 changes: 35 additions & 0 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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() }
)
}
}
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 }

0 comments on commit 0130295

Please sign in to comment.