Skip to content

Commit

Permalink
Fixed test profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
nschcolnicov committed Nov 28, 2024
1 parent c516baf commit efafd5b
Show file tree
Hide file tree
Showing 9 changed files with 342 additions and 127 deletions.
106 changes: 7 additions & 99 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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:
branches:
Expand All @@ -26,9 +26,10 @@ concurrency:
cancel-in-progress: true

jobs:
test_with_test_profile:
test:
name: "${{ matrix.NXF_VER }} | ${{ matrix.test_profile }} | ${{ matrix.compute_profile }}"
if: github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnafusion')
# 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/rnafusion') }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -40,11 +41,12 @@ jobs:
- "test_stub"
- "test_build_stub"
compute_profile:
- "conda"
- "docker"
- "singularity"
- "conda"
isMaster:
- ${{ github.base_ref == 'master' }}
# Exclude conda and singularity on dev
exclude:
- isMaster: false
compute_profile: "conda"
Expand Down Expand Up @@ -114,101 +116,7 @@ jobs:
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
with:
report_paths: test.xml
annotate_only: true

test_with_secret_test_profile:
name: "${{ matrix.NXF_VER }} | ${{ matrix.secret_test_profile }} | ${{ matrix.compute_profile }}"
if: github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnafusion')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
NXF_VER:
- "24.04.2"
- "latest-everything"
secret_test_profile:
- "test"
- "test_build"
- "test_cosmic"
compute_profile:
- "conda"
- "docker"
- "singularity"
isMaster:
- ${{ github.base_ref == 'master' }}
exclude:
- isMaster: false
compute_profile: "conda"
- isMaster: false
compute_profile: "singularity"
steps:
- name: Check out pipeline code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0

- name: Set up Nextflow
uses: nf-core/setup-nextflow@v2
with:
version: "${{ matrix.NXF_VER }}"

- name: Set up Apptainer
if: matrix.compute_profile == 'singularity'
uses: eWaterCycle/setup-apptainer@main

- name: Set up Singularity
if: matrix.compute_profile == 'singularity'
run: |
mkdir -p $NXF_SINGULARITY_CACHEDIR
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
- name: Set up Miniconda
if: matrix.compute_profile == 'conda'
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
with:
miniconda-version: "latest"
auto-update-conda: true
conda-solver: libmamba
channels: conda-forge,bioconda

- name: Set up Conda
if: matrix.compute_profile == 'conda'
run: |
echo $(realpath $CONDA)/condabin >> $GITHUB_PATH
echo $(realpath python) >> $GITHUB_PATH
- name: Clean up Disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- uses: actions/setup-python@v4
with:
python-version: "3.11"
architecture: "x64"

- name: Install pdiff to see diff between nf-test snapshots
run: |
python -m pip install --upgrade pip
pip install pdiff
- uses: nf-core/setup-nf-test@v1
with:
version: ${{ env.NFT_VER }}

- name: Run Tests (${{matrix.NXF_VER}} | ${{matrix.secret_test_profile}} | ${{matrix.compute_profile}})
run: |
nf-test test \
--ci \
--tag ${{matrix.secret_test_profile}} \
--profile "+${{ matrix.compute_profile }}" \
--junitxml=test.xml \
--debug --verbose
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always()
if: always() # always run even if the previous step fails
with:
report_paths: test.xml
annotate_only: true
18 changes: 0 additions & 18 deletions conf/test_full.config

This file was deleted.

3 changes: 0 additions & 3 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ profiles {
test_cosmic {
includeConfig 'conf/test_cosmic.config'
}
test_full {
includeConfig 'conf/test_full.config'
}

gitpod {
executor.name = 'local'
Expand Down
17 changes: 16 additions & 1 deletion tests/test.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,23 @@ nextflow_pipeline {
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// Ignore files with timestamps in their names
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 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_pipeline_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}
Expand Down
19 changes: 17 additions & 2 deletions tests/test_build.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ nextflow_pipeline {
profile "test_build"
tag "pipeline"
tag "pipeline_rnafusion"
tag "build"
tag "test_build"

test("test_build with fastp_trim") {

Expand Down Expand Up @@ -48,8 +48,23 @@ nextflow_pipeline {
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// Ignore files with timestamps in their names
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 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_pipeline_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build_stub.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nextflow_pipeline {
options "-stub" // TODO remove once the pipeline is fixed
tag "pipeline"
tag "pipeline_rnafusion"
tag "build"
tag "test_build_stub"

test("stub test_build with fastp_trim") {

Expand Down
48 changes: 47 additions & 1 deletion tests/test_cosmic.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,54 @@ nextflow_pipeline {
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// Ignore files with timestamps in their names
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_pipeline_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}

test("test cosmic no fastp trim build") {

when {
params {
outdir = "$outputDir"
fastp_trim = false
}
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// Ignore files with timestamps in their names
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 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_pipeline_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}
Expand Down
19 changes: 17 additions & 2 deletions tests/test_stub.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nextflow_pipeline {
options "-stub" // TODO remove once the pipeline is fixed
tag "pipeline"
tag "pipeline_rnafusion"
tag "test"
tag "test_stub"

test("stub test with fastp trim") {

Expand Down Expand Up @@ -55,8 +55,23 @@ nextflow_pipeline {
}

then {
// stable_name: All files + folders in ${params.outdir}/ with a stable name
// Ignore files with timestamps in their names
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 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_pipeline_software_mqc_versions.yml"),
// All stable path name, with a relative path
stable_name,
// All files with stable contents
stable_path
).match() }
)
}
}
Expand Down
Loading

0 comments on commit efafd5b

Please sign in to comment.