diff --git a/.github/workflows/ci-changes.yml b/.github/workflows/ci-changes.yml new file mode 100644 index 000000000..398f7d312 --- /dev/null +++ b/.github/workflows/ci-changes.yml @@ -0,0 +1,85 @@ +name: nf-test on changes +# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors +on: + pull_request: + branches: + - dev + +env: + NXF_ANSI_LOG: false + +jobs: + changes: + name: Check for changes + runs-on: ubuntu-latest + outputs: + # Expose matched filters as job 'modules' output variable + tags: ${{ steps.filter.outputs.changes }} + steps: + - uses: actions/checkout@v2 + + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: "tests/config/tags.yml" + + test_changes: + name: ${{ matrix.tags }} ${{ matrix.component }} ${{ matrix.profile }} + runs-on: ubuntu-20.04 + needs: changes + if: needs.changes.outputs.tags != '[]' + strategy: + fail-fast: false + matrix: + tags: ["${{ fromJson(needs.changes.outputs.tags) }}"] + profile: ["docker"] # TODO Add singularity/conda + component: ["pipeline"] # TODO , "subworkflows", "modules"] + steps: + - name: Check out pipeline code + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: /usr/local/bin/ + key: ${{ runner.os }} + restore-keys: | + ${{ runner.os }}-nextflow- + + - name: Install Nextflow + env: + CAPSULE_LOG: none + run: | + wget -qO- get.nextflow.io | bash + sudo mv nextflow /usr/local/bin/ + + - name: Install nf-test + run: | + wget -qO- https://code.askimed.com/install/nf-test | bash + sudo mv nf-test /usr/local/bin/ + + - name: Set up Singularity + if: matrix.profile == 'singularity' + uses: eWaterCycle/setup-singularity@v5 + with: + singularity-version: 3.7.1 + + - name: Set up miniconda + if: matrix.profile == 'conda' + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + channels: conda-forge,bioconda,defaults + python-version: ${{ matrix.python-version }} + + - name: Conda clean + if: matrix.profile == 'conda' + run: conda clean -a + + - name: Run nf-test + run: nf-test test --profile=${{ matrix.profile }} tests/${{ matrix.component }}/${{ matrix.tags }}/*.nf.test --junitxml=${{ matrix.tags }}.xml + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: "${{ matrix.tags }}.xml" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d71cadb70..1c4fdb8fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,9 @@ name: nf-core CI # This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors on: - push: + pull_request: branches: - dev - pull_request: release: types: [published] @@ -13,7 +12,7 @@ env: jobs: test: - name: Run pipeline with test data + name: Run ${{ matrix.profile }}-${{ matrix.NXF_VER }} pipeline test # Only run on push if this is the nf-core dev branch (merged PRs) if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }}" runs-on: ubuntu-latest @@ -22,113 +21,56 @@ jobs: NXF_VER: - "21.10.3" - "latest-everything" + test: + - "default" + profile: ["docker"] + exclude: + - NXF_VER: "latest-everything" + profile: "conda" steps: - name: Check out pipeline code uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: /usr/local/bin/nextflow + key: ${{ runner.os }} + restore-keys: | + ${{ runner.os }}-nextflow- + - name: Install Nextflow uses: nf-core/setup-nextflow@v1 with: version: "${{ matrix.NXF_VER }}" - - name: Run pipeline with test data - run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results - - star_salmon: - name: Test STAR Salmon with workflow parameters - if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }} - runs-on: ubuntu-latest - strategy: - matrix: - parameters: - - "--skip_qc" - - "--skip_trimming" - - "--gtf false" - - "--star_index false" - - "--transcript_fasta false" - - "--min_mapped_reads 90" - - "--with_umi" - - "--with_umi --skip_trimming" - - "--remove_ribo_rna --skip_qualimap" - - "--bam_csi_index" - - "--save_align_intermeds --save_reference" - - "--featurecounts_group_type false" - steps: - - name: Check out pipeline code - uses: actions/checkout@v2 - - - name: Install Nextflow - run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ - - - name: Run pipeline with STAR and various parameters - run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner star_salmon ${{ matrix.parameters }} --outdir ./results - - star_rsem: - name: Test STAR RSEM with workflow parameters - if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }} - runs-on: ubuntu-latest - strategy: - matrix: - parameters: - - "--skip_qc" - - "--rsem_index false" - steps: - - name: Check out pipeline code - uses: actions/checkout@v2 - - - name: Install Nextflow - run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ - - - name: Run pipeline with RSEM STAR and various parameters + - name: Install nf-test run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner star_rsem ${{ matrix.parameters }} --outdir ./results + wget -qO- https://code.askimed.com/install/nf-test | bash + sudo mv nf-test /usr/local/bin/ - hisat2: - name: Test HISAT2 with workflow parameters - if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }} - runs-on: ubuntu-latest - strategy: - matrix: - parameters: - - "--skip_qc" - - "--hisat2_index false" - steps: - - name: Check out pipeline code - uses: actions/checkout@v2 - - - name: Install Nextflow - run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + - name: Set up Singularity + if: matrix.profile == 'singularity' + uses: eWaterCycle/setup-singularity@v5 + with: + singularity-version: 3.7.1 - - name: Run pipeline with HISAT2 and various parameters - run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner hisat2 ${{ matrix.parameters }} --outdir ./results + - name: Set up miniconda + if: matrix.profile == 'conda' + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + channels: conda-forge,bioconda,defaults + python-version: ${{ matrix.python-version }} - salmon: - name: Test Salmon with workflow parameters - if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }} - runs-on: ubuntu-latest - strategy: - matrix: - parameters: - - "--skip_qc --skip_alignment" - - "--salmon_index false --transcript_fasta false" - steps: - - name: Check out pipeline code - uses: actions/checkout@v2 + - name: Conda clean + if: matrix.profile == 'conda' + run: conda clean -a - - name: Install Nextflow - run: | - wget -qO- get.nextflow.io | bash - sudo mv nextflow /usr/local/bin/ + - name: Run nf-test + run: nf-test test --profile=${{ matrix.profile }} tests/pipeline/default/*.nf.test --junitxml=default.xml - - name: Run pipeline with Salmon and various parameters - run: | - nextflow run ${GITHUB_WORKSPACE} -profile test,docker --pseudo_aligner salmon ${{ matrix.parameters }} --outdir ./results + - name: Publish Test Report + uses: mikepenz/action-junit-report@v3 + if: always() # always run even if the previous step fails + with: + report_paths: "default.xml" diff --git a/.gitignore b/.gitignore index 5124c9ac7..089a40797 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ results/ testing/ testing* *.pyc +.nf-test diff --git a/.nf-core.yml b/.nf-core.yml index 40bcac74d..ca3842aeb 100644 --- a/.nf-core.yml +++ b/.nf-core.yml @@ -4,3 +4,4 @@ lint: - assets/email_template.html - assets/email_template.txt - lib/NfcoreTemplate.groovy + actions_ci: False diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ad658113..d5375a7c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhancements & fixes - Update modules to latest restructuring on nf-core/modules +- [[#883](https://github.com/nf-core/rnaseq/pull/883)] - Migrate CI tests to nf-test ### Parameters diff --git a/nf-test.config b/nf-test.config new file mode 100644 index 000000000..703b5a4ec --- /dev/null +++ b/nf-test.config @@ -0,0 +1,8 @@ +config { + + testsDir "tests" + workDir ".nf-test" + configFile "conf/test.config" + // profile "docker" + +} diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config new file mode 100644 index 000000000..3cd8ab3cb --- /dev/null +++ b/tests/config/nextflow.config @@ -0,0 +1,38 @@ +params { + outdir = "output/" + publish_dir_mode = "copy" + enable_conda = false + singularity_pull_docker_container = false + max_cpus = 2 + max_memory = 6.GB + max_time = 6.h +} + +process { + cpus = 2 + memory = 6.GB + time = 48.h +} + +if ("$PROFILE" == "singularity") { + singularity.enabled = true + singularity.autoMounts = true +} else if ("$PROFILE" == "conda") { + params.enable_conda = true +} else { + docker.enabled = true + docker.runOptions = '-u \$(id -u):\$(id -g)' +} + +// Load test_data.config containing paths to test data +includeConfig 'test_data.config' + +// Load default nextflow.config for default module params +includeConfig '../../nextflow.config' + +// Load modules.config for default module params +includeConfig '../../conf/modules.config' + +manifest { + nextflowVersion = '!>=21.04.0' +} diff --git a/tests/config/tags.yml b/tests/config/tags.yml new file mode 100644 index 000000000..0ff8e8ab9 --- /dev/null +++ b/tests/config/tags.yml @@ -0,0 +1,48 @@ +# quantify_salmon: +# - subworkflows/local/quantify_salmon.nf +# - tests/subworkflows/local/quantify_salmon/** +# - modules/nf-core/software/salmon/quant/** +# - modules/local/salmon_tx2gene.nf +# - modules/local/salmon_tximport.nf +# - modules/local/salmon_merge_counts.nf +# - modules/local/salmon_summarizedexperiment.nf + +hisat2: + - modules/nf-core/hisat2/** + - subworkflows/nf-core/align_hisat2.nf + - tests/pipeline/hisat2/** + +# quantify_rsem: +# - subworkflows/local/quantify_rsem.nf +# - subworkflows/nf-core/bam_sort_samtools.nf +# - tests/subworkflows/local/quantify_rsem/** +# - modules/nf-core/software/rsem/calculateexpression/** +# - modules/local/rsem_merge_counts.nf + +salmon: + - bin/salmon_summarizedexperiment.r + - bin/salmon_tx2gene.py + - bin/salmon_tximport.r + - modules/local/salmon_summarizedexperiment.nf + - modules/local/salmon_tx2gene.nf + - modules/local/salmon_tximport.nf + - modules/nf-core/salmon/** + - subworkflows/local/quantify_salmon.nf + - tests/pipeline/salmon/** + # - tests/subworkflows/local/quantify_salmon/ + +star_salmon: + - modules/local/star_align_igenomes.nf + - modules/local/star_genomegenerate_igenomes.nf + - modules/nf-core/star/** + - subworkflows/local/align_star.nf + - tests/pipeline/star_salmon/** + +star_rsem: + - bin/prepare-for-rsem.py + - modules/local/rsem_merge_counts.nf + - modules/local/umitools_prepareforrsem.nf + - modules/nf-core/rsem/** + - subworkflows/local/quantify_rsem.nf + - tests/pipeline/star_rsem/** + # - tests/subworkflows/local/quantify_rsem/ diff --git a/tests/config/test_data.config b/tests/config/test_data.config new file mode 100644 index 000000000..0d7304b12 --- /dev/null +++ b/tests/config/test_data.config @@ -0,0 +1,3 @@ +def nf_core_rnaseq_data = "https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/data/" + +includeConfig 'https://github.com/nf-core/modules/raw/master/tests/config/test_data.config' diff --git a/tests/modules/samplesheet_check/main.nf.test b/tests/modules/samplesheet_check/main.nf.test new file mode 100644 index 000000000..4e5ef97fa --- /dev/null +++ b/tests/modules/samplesheet_check/main.nf.test @@ -0,0 +1,19 @@ +nextflow_process { + name "samplesheet_check" + script "modules/local/samplesheet_check.nf" + process "SAMPLESHEET_CHECK" + + test("Should run without failure") { + when { + process { + """ + input[0] = file('https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/samplesheet/v3.4/samplesheet_test.csv', checkIfExists: true) + """ + } + } + + then { + assert process.success + } + } +} diff --git a/tests/pipeline/default/main.nf.test b/tests/pipeline/default/main.nf.test new file mode 100644 index 000000000..1d01b4abd --- /dev/null +++ b/tests/pipeline/default/main.nf.test @@ -0,0 +1,69 @@ +nextflow_pipeline { + + name "default" + script "main.nf" + + test("default test config") { + when { + params { + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 197 + + assert new File("$outputDir/salmon/salmon.merged.gene_counts_length_scaled.rds") + assert new File("$outputDir/salmon/salmon.merged.gene_counts_length_scaled.tsv") + assert new File("$outputDir/salmon/salmon.merged.gene_counts.rds") + assert new File("$outputDir/salmon/salmon.merged.gene_counts_scaled.rds") + assert new File("$outputDir/salmon/salmon.merged.gene_counts_scaled.tsv") + assert new File("$outputDir/salmon/salmon.merged.gene_counts.tsv") + assert new File("$outputDir/salmon/salmon.merged.gene_tpm.tsv") + assert new File("$outputDir/salmon/salmon.merged.transcript_counts.rds") + assert new File("$outputDir/salmon/salmon.merged.transcript_counts.tsv") + assert new File("$outputDir/salmon/salmon.merged.transcript_tpm.tsv") + + assert new File("$outputDir/fastqc/RAP1_IAA_30M_REP1_1_fastqc.html").exists() + assert new File("$outputDir/fastqc/RAP1_IAA_30M_REP1_1_fastqc.zip").exists() + assert new File("$outputDir/fastqc/RAP1_IAA_30M_REP1_2_fastqc.html").exists() + assert new File("$outputDir/fastqc/RAP1_IAA_30M_REP1_2_fastqc.zip").exists() + assert new File("$outputDir/fastqc/RAP1_UNINDUCED_REP1_fastqc.html").exists() + assert new File("$outputDir/fastqc/RAP1_UNINDUCED_REP1_fastqc.zip").exists() + assert new File("$outputDir/fastqc/RAP1_UNINDUCED_REP2_fastqc.html").exists() + assert new File("$outputDir/fastqc/RAP1_UNINDUCED_REP2_fastqc.zip").exists() + assert new File("$outputDir/fastqc/WT_REP1_1_fastqc.html").exists() + assert new File("$outputDir/fastqc/WT_REP1_1_fastqc.zip").exists() + assert new File("$outputDir/fastqc/WT_REP1_2_fastqc.html").exists() + assert new File("$outputDir/fastqc/WT_REP1_2_fastqc.zip").exists() + assert new File("$outputDir/fastqc/WT_REP2_1_fastqc.html").exists() + assert new File("$outputDir/fastqc/WT_REP2_1_fastqc.zip").exists() + assert new File("$outputDir/fastqc/WT_REP2_2_fastqc.html").exists() + assert new File("$outputDir/fastqc/WT_REP2_2_fastqc.zip").exists() + + assert new File("$outputDir/multiqc/star_salmon/multiqc_report.html").exists() + + assert new File("$outputDir/star_salmon/RAP1_IAA_30M_REP1.markdup.sorted.bam").exists() + assert new File("$outputDir/star_salmon/RAP1_IAA_30M_REP1.markdup.sorted.bam.bai").exists() + assert new File("$outputDir/star_salmon/RAP1_UNINDUCED_REP1.markdup.sorted.bam").exists() + assert new File("$outputDir/star_salmon/RAP1_UNINDUCED_REP1.markdup.sorted.bam.bai").exists() + assert new File("$outputDir/star_salmon/RAP1_UNINDUCED_REP2.markdup.sorted.bam").exists() + assert new File("$outputDir/star_salmon/RAP1_UNINDUCED_REP2.markdup.sorted.bam.bai").exists() + assert new File("$outputDir/star_salmon/WT_REP1.markdup.sorted.bam").exists() + assert new File("$outputDir/star_salmon/WT_REP1.markdup.sorted.bam.bai").exists() + assert new File("$outputDir/star_salmon/WT_REP2.markdup.sorted.bam").exists() + assert new File("$outputDir/star_salmon/WT_REP2.markdup.sorted.bam.bai").exists() + + assert new File("$outputDir/trimgalore/RAP1_IAA_30M_REP1_1.fastq.gz_trimming_report.txt").exists() + assert new File("$outputDir/trimgalore/RAP1_IAA_30M_REP1_2.fastq.gz_trimming_report.txt").exists() + assert new File("$outputDir/trimgalore/RAP1_UNINDUCED_REP1.fastq.gz_trimming_report.txt").exists() + assert new File("$outputDir/trimgalore/RAP1_UNINDUCED_REP2.fastq.gz_trimming_report.txt").exists() + assert new File("$outputDir/trimgalore/WT_REP1_1.fastq.gz_trimming_report.txt").exists() + assert new File("$outputDir/trimgalore/WT_REP1_2.fastq.gz_trimming_report.txt").exists() + assert new File("$outputDir/trimgalore/WT_REP2_1.fastq.gz_trimming_report.txt").exists() + assert new File("$outputDir/trimgalore/WT_REP2_2.fastq.gz_trimming_report.txt").exists() + } + } + +} diff --git a/tests/pipeline/hisat2/main.nf.test b/tests/pipeline/hisat2/main.nf.test new file mode 100644 index 000000000..109944dd8 --- /dev/null +++ b/tests/pipeline/hisat2/main.nf.test @@ -0,0 +1,38 @@ +nextflow_pipeline { + + name "hisat2" + script "main.nf" + + test("with skip_qc workflow parameters") { + when { + params { + aligner = "hisat2" + skip_qc = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 120 + // FIXME assert snapshot(workflow).match() + } + } + + test("with hisat2_index false workflow parameters") { + when { + params { + aligner = "hisat2" + hisat2_index = false + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 186 + // FIXME assert snapshot(workflow).match() + } + } + +} diff --git a/tests/pipeline/salmon/main.nf.test b/tests/pipeline/salmon/main.nf.test new file mode 100644 index 000000000..700d219f6 --- /dev/null +++ b/tests/pipeline/salmon/main.nf.test @@ -0,0 +1,40 @@ +nextflow_pipeline { + + name "Salmon" + script "main.nf" + + test("with skip_qc skip_alignment workflow parameters") { + when { + params { + pseudo_aligner = "salmon" + skip_qc = true + skip_alignment = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 33 + // FIXME assert snapshot(workflow).match() + } + } + + test("with salmon_index false transcript_fasta false workflow parameters") { + when { + params { + pseudo_aligner = "salmon" + salmon_index = false + transcript_fasta = false + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 199 + // FIXME assert snapshot(workflow).match() + } + } + +} diff --git a/tests/pipeline/star_rsem/main.nf.test b/tests/pipeline/star_rsem/main.nf.test new file mode 100644 index 000000000..ce00fa8e7 --- /dev/null +++ b/tests/pipeline/star_rsem/main.nf.test @@ -0,0 +1,39 @@ +nextflow_pipeline { + + name "STAR RSEM" + script "main.nf" + + test("with skip_qc workflow parameters") { + when { + params { + aligner = "star_rsem" + skip_qc = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 120 + // FIXME assert snapshot(workflow).match() + } + } + + test("with rsem_index false workflow parameters") { + when { + params { + pseudo_aligner = "salmon" + aligner = "star_rsem" + rsem_index = false + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 187 + // FIXME assert snapshot(workflow).match() + } + } + +} diff --git a/tests/pipeline/star_salmon/main.nf.test b/tests/pipeline/star_salmon/main.nf.test new file mode 100644 index 000000000..cf1bee7a2 --- /dev/null +++ b/tests/pipeline/star_salmon/main.nf.test @@ -0,0 +1,187 @@ +nextflow_pipeline { + + name "STAR Salmon" + script "main.nf" + + test("with skip_qc workflow parameters") { + when { + params { + aligner = "star_salmon" + skip_qc = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 130 + // FIXME assert snapshot(workflow).match() + } + } + + test("with skim_trimming workflow parameters") { + when { + params { + aligner = "star_salmon" + skim_trimming = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 197 + // FIXME assert snapshot(workflow).match() + } + } + + test("with gtf false workflow parameters") { + when { + params { + aligner = "star_salmon" + gtf = false + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 198 + // FIXME assert snapshot(workflow).match() + } + } + + test("with star_index false workflow parameters") { + when { + params { + aligner = "star_salmon" + star_index = false + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 197 + // FIXME assert snapshot(workflow).match() + } + } + + test("with transcript_fasta false workflow parameters") { + when { + params { + aligner = "star_salmon" + transcript_fasta = false + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 199 + // FIXME assert snapshot(workflow).match() + } + } + + test("with min_mapped_reads 90 workflow parameters") { + when { + params { + aligner = "star_salmon" + min_mapped_reads = 152 + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 186 + // FIXME assert snapshot(workflow).match() + } + } + + test("with with_umi workflow parameters") { + when { + params { + aligner = "star_salmon" + with_umi = true + outdir = "$outputDir" + } + } + + then { + // FIXME ValueError: Must supply --bc-pattern for single-end + assert workflow.failed + // assert workflow.trace.tasks().size() == 186 + // FIXME assert snapshot(workflow).match() + } + } + + test("with with_umi skip_trimming workflow parameters") { + when { + params { + aligner = "star_salmon" + with_umi = true + skip_trimming = true + outdir = "$outputDir" + } + } + + then { + // FIXME ValueError: Must supply --bc-pattern for single-end + assert workflow.failed + assert workflow.trace.tasks().size() == 186 + // FIXME assert snapshot(workflow).match() + } + } + + test("with remove_ribo_rna and skip_qualimap workflow parameters") { + when { + params { + aligner = "star_salmon" + remove_ribo_rna = true + skip_qualimap = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 197 + // FIXME assert snapshot(workflow).match() + } + } + + test("with save_align_intermeds save_reference workflow parameters") { + when { + params { + aligner = "star_salmon" + save_align_intermeds = true + save_reference = true + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 197 + // FIXME assert snapshot(workflow).match() + } + } + + test("with featurecounts_group_type false workflow parameters") { + when { + params { + aligner = "star_salmon" + featurecounts_group_type = false + outdir = "$outputDir" + } + } + + then { + assert workflow.success + assert workflow.trace.tasks().size() == 187 + // FIXME assert snapshot(workflow).match() + } + } + +} diff --git a/tests/subworkflows/input_check/main.nf.test b/tests/subworkflows/input_check/main.nf.test new file mode 100644 index 000000000..d468baa2c --- /dev/null +++ b/tests/subworkflows/input_check/main.nf.test @@ -0,0 +1,21 @@ +nextflow_workflow { + + name "input_check subworkflow" + script "subworkflows/local/input_check.nf" + workflow "INPUT_CHECK" + + test("Should run without failure") { + when { + workflow { + """ + input[0] = file('https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/samplesheet/v3.4/samplesheet_test.csv', checkIfExists: true) + """ + } + } + + then { + assert workflow.success + } + } + +} diff --git a/tests/subworkflows/quantify_rsem/main.nf.test b/tests/subworkflows/quantify_rsem/main.nf.test new file mode 100644 index 000000000..c8005aeef --- /dev/null +++ b/tests/subworkflows/quantify_rsem/main.nf.test @@ -0,0 +1,25 @@ +nextflow_workflow { + + name "Test quantify_rsem subworkflow" + script "subworkflows/local/quantify_rsem.nf" + workflow "QUANTIFY_RSEM" + + test("Basic test") { + when { + workflow { + """ + input[0] = [ [ id:'test', single_end:true ], + file('https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/sarscov2/illumina/bam/test.single_end.sorted.bam', checkIfExists: true)] + + input[1] = file('https://github.com/nf-core/test-datasets/raw/rnaseq/reference/rsem.tar.gz', checkIfExists: true) + """ + } + } + + then { + // FIXME + assert workflow.failed + } + } + +} diff --git a/tests/subworkflows/quantify_salmon/main.nf.test b/tests/subworkflows/quantify_salmon/main.nf.test new file mode 100644 index 000000000..7791e826b --- /dev/null +++ b/tests/subworkflows/quantify_salmon/main.nf.test @@ -0,0 +1,29 @@ +nextflow_workflow { + + name "Test quantify_salmon subworkflow" + script "subworkflows/local/quantify_salmon.nf" + workflow "QUANTIFY_SALMON" + + test("Basic test") { + when { + workflow { + """ + input[0] = [ [ id:'test', single_end: false ], + file(params.test_data['homo_sapiens']['illumina']['test_paired_end_sorted_bam'], checkIfExists: true) + ] + input[1] = file(params.test_data['homo_sapiens']['genome']['index_salmon'], checkIfExists: true) + input[2] = file(params.test_data['homo_sapiens']['genome']['transcriptome_fasta'], checkIfExists: true) + input[3] = file(params.test_data['homo_sapiens']['genome']['genome_gtf'], checkIfExists: true) + input[4] = true + input[5] = '' + """ + } + } + + then { + // FIXME salmon index doesn't exist + assert workflow.failed + } + } + +} diff --git a/tests/subworkflows/quantify_salmon/test.yml b/tests/subworkflows/quantify_salmon/test.yml new file mode 100644 index 000000000..d1d487839 --- /dev/null +++ b/tests/subworkflows/quantify_salmon/test.yml @@ -0,0 +1,7 @@ +- name: subworkflow quantify_salmon + command: nextflow run ./tests/subworkflows/local/quantify_salmon/ -entry test_quantify_salmon -c tests/config/nextflow.config + tags: + - quantify_salmon + - failing + exit_code: 1 + # TODO files: