From 4bb0af18372f2009df260f53371d4c007de41aae Mon Sep 17 00:00:00 2001 From: Jonathan Manning Date: Tue, 21 Jan 2025 18:20:35 +0000 Subject: [PATCH] Add test for no fasta --- tests/nofasta.nf.test | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/nofasta.nf.test diff --git a/tests/nofasta.nf.test b/tests/nofasta.nf.test new file mode 100644 index 000000000..4413d4c41 --- /dev/null +++ b/tests/nofasta.nf.test @@ -0,0 +1,39 @@ +nextflow_pipeline { + + name "Test pipeline by skipping trimming options" + script "../main.nf" + + test("Params: no fasta") { + + when { + params { + outdir = "$outputDir" + skip_alignment = true + fasta = null + additional_fasta = null + salmon_index = null + transcript_fasta = "https://raw.githubusercontent.com/nf-core/test-datasets/d1f59361a013a8820c824d606f5853db0d6c7999/reference/transcriptome_match_gtf.fa" + } + } + + 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_rnaseq_software_mqc_versions.yml"), + // All stable path name, with a relative path + stable_name, + // All files with stable contents + stable_path + ).match() } + ) + } + } +}