From d6206f412a574531096340073c70c7f98ea2f07e Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:33:45 +0100 Subject: [PATCH 1/3] Reorganise pipeline tests into flat structure Changes: - Move all test files from tests/tests/ to test/*.nf.test - Makes structure more flat and discovery easier at the cost of looking more untidy. - To be discussed in PR! --- CHANGELOG.md | 1 + nf-test.config | 2 +- .../default/main.nf.test => default.main.nf.test} | 4 ++-- .../main.nf.test.snap => default.main.nf.test.snap} | 0 .../main.nf.test => featurecounts.main.nf.test} | 4 ++-- .../main.nf.test => kallisto.main.nf.nf.test} | 8 ++------ .../main.nf.test => min_mapped_reads.main.nf.test} | 4 ++-- tests/{config => }/nextflow.config | 0 .../main.nf.test => remove_ribo_rna.main.nf.test} | 4 ++-- .../salmon/main.nf.test => salmon.main.nf.test} | 8 ++------ .../skip_qc/main.nf.test => skip_qc.main.nf.test} | 4 ++-- .../main.nf.test => skip_trimming.main.nf.test} | 4 ++-- tests/tests/kallisto/main.nf.test.snap | 12 ------------ tests/tests/salmon/main.nf.test.snap | 12 ------------ 14 files changed, 18 insertions(+), 49 deletions(-) rename tests/{tests/default/main.nf.test => default.main.nf.test} (89%) rename tests/{tests/default/main.nf.test.snap => default.main.nf.test.snap} (100%) rename tests/{tests/featurecounts/main.nf.test => featurecounts.main.nf.test} (84%) rename tests/{tests/kallisto/main.nf.test => kallisto.main.nf.nf.test} (67%) rename tests/{tests/min_mapped_reads/main.nf.test => min_mapped_reads.main.nf.test} (86%) rename tests/{config => }/nextflow.config (100%) rename tests/{tests/remove_ribo_rna/main.nf.test => remove_ribo_rna.main.nf.test} (86%) rename tests/{tests/salmon/main.nf.test => salmon.main.nf.test} (67%) rename tests/{tests/skip_qc/main.nf.test => skip_qc.main.nf.test} (87%) rename tests/{tests/skip_trimming/main.nf.test => skip_trimming.main.nf.test} (86%) delete mode 100644 tests/tests/kallisto/main.nf.test.snap delete mode 100644 tests/tests/salmon/main.nf.test.snap diff --git a/CHANGELOG.md b/CHANGELOG.md index fd5a2d557..81e1eb46e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,7 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements - [PR #1266](https://github.com/nf-core/rnaseq/pull/1266) - Delete unecessary tags from nf.test files for modules and subworkflows - [PR #1253](https://github.com/nf-core/rnaseq/pull/1253) - Use nf-test files as matrix to test over in CI/CD for efficiency - [PR #1278](https://github.com/nf-core/rnaseq/pull/1278) - Delocalise pseudo quant workflow +- [PR ####](https://github.com/nf-core/rnaseq/pull/####) - Reorganise pipeline level tests into flat directory structure ### Parameters diff --git a/nf-test.config b/nf-test.config index 59b868801..f126b460a 100644 --- a/nf-test.config +++ b/nf-test.config @@ -6,7 +6,7 @@ config { workDir System.getenv("NFT_WORKDIR") ?: ".nf-test" // Location of an optional nextflow.config file specific for executing pipeline tests - configFile "tests/config/nextflow.config" + configFile "tests/nextflow.config" profile "test" } diff --git a/tests/tests/default/main.nf.test b/tests/default.main.nf.test similarity index 89% rename from tests/tests/default/main.nf.test rename to tests/default.main.nf.test index 403e9f5f9..88e760c25 100644 --- a/tests/tests/default/main.nf.test +++ b/tests/default.main.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline with default settings" + script "../main.nf" tag "rnaseq" tag "PIPELINE" diff --git a/tests/tests/default/main.nf.test.snap b/tests/default.main.nf.test.snap similarity index 100% rename from tests/tests/default/main.nf.test.snap rename to tests/default.main.nf.test.snap diff --git a/tests/tests/featurecounts/main.nf.test b/tests/featurecounts.main.nf.test similarity index 84% rename from tests/tests/featurecounts/main.nf.test rename to tests/featurecounts.main.nf.test index bc51fe2e0..30362d3fb 100644 --- a/tests/tests/featurecounts/main.nf.test +++ b/tests/featurecounts.main.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline with featureCounts with group type false" + script "../main.nf" tag "rnaseq" tag "PIPELINE" diff --git a/tests/tests/kallisto/main.nf.test b/tests/kallisto.main.nf.nf.test similarity index 67% rename from tests/tests/kallisto/main.nf.test rename to tests/kallisto.main.nf.nf.test index e36b4cb9c..732cd82b1 100644 --- a/tests/tests/kallisto/main.nf.test +++ b/tests/kallisto.main.nf.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline using Kallisto" + script "../main.nf" tag "rnaseq" tag "PIPELINE" @@ -19,10 +19,6 @@ nextflow_pipeline { then { assert workflow.success - - assertAll( - { assert snapshot(UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml")).match("software_versions") } - ) } } } diff --git a/tests/tests/min_mapped_reads/main.nf.test b/tests/min_mapped_reads.main.nf.test similarity index 86% rename from tests/tests/min_mapped_reads/main.nf.test rename to tests/min_mapped_reads.main.nf.test index d0e1dfe36..8c8366bbb 100644 --- a/tests/tests/min_mapped_reads/main.nf.test +++ b/tests/min_mapped_reads.main.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline with min_mapped_reads = 90" + script "../main.nf" tag "rnaseq" tag "PIPELINE" diff --git a/tests/config/nextflow.config b/tests/nextflow.config similarity index 100% rename from tests/config/nextflow.config rename to tests/nextflow.config diff --git a/tests/tests/remove_ribo_rna/main.nf.test b/tests/remove_ribo_rna.main.nf.test similarity index 86% rename from tests/tests/remove_ribo_rna/main.nf.test rename to tests/remove_ribo_rna.main.nf.test index a242a8da4..955dde7cf 100644 --- a/tests/tests/remove_ribo_rna/main.nf.test +++ b/tests/remove_ribo_rna.main.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline with ribosomal RNA removal" + script "../main.nf" tag "rnaseq" tag "PIPELINE" diff --git a/tests/tests/salmon/main.nf.test b/tests/salmon.main.nf.test similarity index 67% rename from tests/tests/salmon/main.nf.test rename to tests/salmon.main.nf.test index 72f8fd4e7..d26c839c3 100644 --- a/tests/tests/salmon/main.nf.test +++ b/tests/salmon.main.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline using Salmon" + script "../main.nf" tag "rnaseq" tag "PIPELINE" @@ -19,10 +19,6 @@ nextflow_pipeline { then { assert workflow.success - - assertAll( - { assert snapshot(UTILS.removeNextflowVersion("$outputDir/pipeline_info/nf_core_rnaseq_software_mqc_versions.yml")).match("software_versions") } - ) } } } diff --git a/tests/tests/skip_qc/main.nf.test b/tests/skip_qc.main.nf.test similarity index 87% rename from tests/tests/skip_qc/main.nf.test rename to tests/skip_qc.main.nf.test index 788ed432e..1979a1b8d 100644 --- a/tests/tests/skip_qc/main.nf.test +++ b/tests/skip_qc.main.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline with QC disabled" + script "../main.nf" tag "rnaseq" tag "PIPELINE" diff --git a/tests/tests/skip_trimming/main.nf.test b/tests/skip_trimming.main.nf.test similarity index 86% rename from tests/tests/skip_trimming/main.nf.test rename to tests/skip_trimming.main.nf.test index f23703f35..8272e0adc 100644 --- a/tests/tests/skip_trimming/main.nf.test +++ b/tests/skip_trimming.main.nf.test @@ -1,7 +1,7 @@ nextflow_pipeline { - name "Test pipeline" - script "../../../main.nf" + name "Test pipeline with trimming disabled" + script "../main.nf" tag "rnaseq" tag "PIPELINE" diff --git a/tests/tests/kallisto/main.nf.test.snap b/tests/tests/kallisto/main.nf.test.snap deleted file mode 100644 index 2deb6fb8d..000000000 --- a/tests/tests/kallisto/main.nf.test.snap +++ /dev/null @@ -1,12 +0,0 @@ -{ - "software_versions": { - "content": [ - "{BBMAP_BBSPLIT={bbmap=39.01}, CAT_FASTQ={cat=8.3}, CUSTOM_CATADDITIONALFASTA={python=3.9.5}, CUSTOM_GETCHROMSIZES={getchromsizes=1.16.1}, CUSTOM_TX2GENE={python=3.9.5}, FQ_SUBSAMPLE={fq=0.9.1 (2022-02-22)}, GTF2BED={perl=5.26.2}, GTF_FILTER={python=3.9.5}, GUNZIP_ADDITIONAL_FASTA={gunzip=1.1}, GUNZIP_GTF={gunzip=1.1}, KALLISTO_INDEX={kallisto=0.48.0}, KALLISTO_QUANT={kallisto=0.48.0}, SALMON_QUANT={salmon=1.10.1}, SE_GENE={bioconductor-summarizedexperiment=1.32.0}, TRIMGALORE={trimgalore=0.6.7, cutadapt=3.4}, TXIMETA_TXIMPORT={bioconductor-tximeta=1.20.1}, UNTAR_SALMON_INDEX={untar=1.3}, Workflow={nf-core/rnaseq=v3.15.0dev}}" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-04-10T10:13:15.867122" - } -} \ No newline at end of file diff --git a/tests/tests/salmon/main.nf.test.snap b/tests/tests/salmon/main.nf.test.snap deleted file mode 100644 index 831b1e14b..000000000 --- a/tests/tests/salmon/main.nf.test.snap +++ /dev/null @@ -1,12 +0,0 @@ -{ - "software_versions": { - "content": [ - "{BBMAP_BBSPLIT={bbmap=39.01}, CAT_FASTQ={cat=8.3}, CUSTOM_CATADDITIONALFASTA={python=3.9.5}, CUSTOM_GETCHROMSIZES={getchromsizes=1.16.1}, CUSTOM_TX2GENE={python=3.9.5}, FQ_SUBSAMPLE={fq=0.9.1 (2022-02-22)}, GTF2BED={perl=5.26.2}, GTF_FILTER={python=3.9.5}, GUNZIP_ADDITIONAL_FASTA={gunzip=1.1}, GUNZIP_GTF={gunzip=1.1}, SALMON_QUANT={salmon=1.10.1}, SE_GENE={bioconductor-summarizedexperiment=1.32.0}, TRIMGALORE={trimgalore=0.6.7, cutadapt=3.4}, TXIMETA_TXIMPORT={bioconductor-tximeta=1.20.1}, UNTAR_SALMON_INDEX={untar=1.3}, Workflow={nf-core/rnaseq=v3.15.0dev}}" - ], - "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" - }, - "timestamp": "2024-04-10T10:31:20.108379" - } -} \ No newline at end of file From d1c636a7b6c1f78134faabde63c77d4241b027ad Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:54:28 +0100 Subject: [PATCH 2/3] Use profile test --input parameter --- .../tests/main.pipeline_initialistion.workflow.nf.test | 4 ---- tests/default.main.nf.test | 9 ++++----- tests/featurecounts.main.nf.test | 1 - tests/kallisto.main.nf.nf.test | 1 - tests/min_mapped_reads.main.nf.test | 1 - tests/remove_ribo_rna.main.nf.test | 1 - tests/salmon.main.nf.test | 1 - tests/skip_qc.main.nf.test | 1 - tests/skip_trimming.main.nf.test | 1 - 9 files changed, 4 insertions(+), 16 deletions(-) diff --git a/subworkflows/local/utils_nfcore_rnaseq_pipeline/tests/main.pipeline_initialistion.workflow.nf.test b/subworkflows/local/utils_nfcore_rnaseq_pipeline/tests/main.pipeline_initialistion.workflow.nf.test index e0b311d22..c1db3fda8 100644 --- a/subworkflows/local/utils_nfcore_rnaseq_pipeline/tests/main.pipeline_initialistion.workflow.nf.test +++ b/subworkflows/local/utils_nfcore_rnaseq_pipeline/tests/main.pipeline_initialistion.workflow.nf.test @@ -8,10 +8,6 @@ nextflow_workflow { when { params { - // parameters copied from test profile. - // We should be able to automatically import these somehow. - input = "https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv" - // Genome references fasta = "https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/reference/genome.fasta" gtf = "https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/reference/genes_with_empty_tid.gtf.gz" diff --git a/tests/default.main.nf.test b/tests/default.main.nf.test index 88e760c25..46e973b11 100644 --- a/tests/default.main.nf.test +++ b/tests/default.main.nf.test @@ -7,12 +7,11 @@ nextflow_pipeline { test("Default profile test") { - when { - params { - outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' - } + when { + params { + outdir = "$outputDir" } + } then { assert workflow.success diff --git a/tests/featurecounts.main.nf.test b/tests/featurecounts.main.nf.test index 30362d3fb..cb978a8c6 100644 --- a/tests/featurecounts.main.nf.test +++ b/tests/featurecounts.main.nf.test @@ -10,7 +10,6 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' featurecounts_group_type = false } } diff --git a/tests/kallisto.main.nf.nf.test b/tests/kallisto.main.nf.nf.test index 732cd82b1..4a9d30cd5 100644 --- a/tests/kallisto.main.nf.nf.test +++ b/tests/kallisto.main.nf.nf.test @@ -10,7 +10,6 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' pseudo_aligner = 'kallisto' skip_qc = true skip_alignment = true diff --git a/tests/min_mapped_reads.main.nf.test b/tests/min_mapped_reads.main.nf.test index 8c8366bbb..6d59bfafd 100644 --- a/tests/min_mapped_reads.main.nf.test +++ b/tests/min_mapped_reads.main.nf.test @@ -10,7 +10,6 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' min_mapped_reads = 90 } } diff --git a/tests/remove_ribo_rna.main.nf.test b/tests/remove_ribo_rna.main.nf.test index 955dde7cf..b4e54a509 100644 --- a/tests/remove_ribo_rna.main.nf.test +++ b/tests/remove_ribo_rna.main.nf.test @@ -10,7 +10,6 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' remove_ribo_rna = true } } diff --git a/tests/salmon.main.nf.test b/tests/salmon.main.nf.test index d26c839c3..a19210f0d 100644 --- a/tests/salmon.main.nf.test +++ b/tests/salmon.main.nf.test @@ -10,7 +10,6 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' pseudo_aligner = 'salmon' skip_qc = true skip_alignment = true diff --git a/tests/skip_qc.main.nf.test b/tests/skip_qc.main.nf.test index 1979a1b8d..f9a34fd8f 100644 --- a/tests/skip_qc.main.nf.test +++ b/tests/skip_qc.main.nf.test @@ -10,7 +10,6 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' skip_qc = true } } diff --git a/tests/skip_trimming.main.nf.test b/tests/skip_trimming.main.nf.test index 8272e0adc..8a9bf5a9d 100644 --- a/tests/skip_trimming.main.nf.test +++ b/tests/skip_trimming.main.nf.test @@ -10,7 +10,6 @@ nextflow_pipeline { when { params { outdir = "$outputDir" - input = 'https://raw.githubusercontent.com/nf-core/test-datasets/7f1614baeb0ddf66e60be78c3d9fa55440465ac8/samplesheet/v3.10/samplesheet_test.csv' skip_qc = true } } From c259f30ed2067355acfbdeb735e6ade04296e47d Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Wed, 10 Apr 2024 14:55:04 +0100 Subject: [PATCH 3/3] indentation --- tests/default.main.nf.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/default.main.nf.test b/tests/default.main.nf.test index 46e973b11..edfb96d70 100644 --- a/tests/default.main.nf.test +++ b/tests/default.main.nf.test @@ -7,11 +7,11 @@ nextflow_pipeline { test("Default profile test") { - when { - params { - outdir = "$outputDir" + when { + params { + outdir = "$outputDir" + } } - } then { assert workflow.success