Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pytest workflow #546

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d8994eb
test(default): Rewrite with pytest-workflow
edmundmiller Dec 22, 2020
c9b39ca
test(star_salmon): Rewrite with pytest-workflow
edmundmiller Dec 22, 2020
15e053c
test: GITHUB_WORKSPACE => main.nf
edmundmiller Dec 22, 2020
115c82d
test(star_salmon): Use two tags instead of one
edmundmiller Dec 22, 2020
67fb0dc
ci: Fix syntax error
edmundmiller Dec 23, 2020
4da30ab
test(star_rsem): Rewrite to use pytest-workflow
edmundmiller Dec 23, 2020
2c9ed44
test(hisat2): Rewrite to use pytest-workflow
edmundmiller Dec 23, 2020
0c90a56
ci: Fix step names
edmundmiller Dec 23, 2020
b0309d1
chore: Remove TODOs
edmundmiller Dec 23, 2020
8ca995a
test(salmon): Rewrite to use pytest-workflow
edmundmiller Dec 23, 2020
a75c060
test(sra_download): Rewrite to use pytest-workflow
edmundmiller Dec 23, 2020
2015a0a
ci: Fix typo
edmundmiller Dec 23, 2020
afdf853
test: Fix naming so tests get picked up by pytest
edmundmiller Dec 23, 2020
5d42375
ci: Fix another yaml typo
edmundmiller Dec 23, 2020
f0ce755
ci: Keep working-directories of failures
edmundmiller Dec 23, 2020
002df2f
test(sra_download): main => main.nf
edmundmiller Dec 23, 2020
ca49170
ci: Add " around matrix parameters
edmundmiller Dec 23, 2020
e002906
ci: Remove -- in params
edmundmiller Jan 8, 2021
8118452
ci: Remove extra STAR tags
edmundmiller Jan 8, 2021
2bb4389
ci: Add continue on failure to SRA download
edmundmiller Jan 8, 2021
7cea5ad
ci: Remove --symlink
edmundmiller Feb 2, 2021
73e4459
ci: Remove multiple workflow threads
edmundmiller Feb 2, 2021
a76691d
Fix typo
edmundmiller Apr 27, 2021
f45767e
ci: Add local modules workflow
edmundmiller Apr 28, 2021
57a8560
test: Add config infrastructure
edmundmiller Apr 28, 2021
d0c9f37
tests: Add modules config
edmundmiller Apr 28, 2021
8a9d3c7
test: Get cleaver with module data includeConfig
edmundmiller Apr 28, 2021
873fd10
test(quantify_salmon): Add initial test
edmundmiller Apr 28, 2021
885e5a8
style: s/'/"
edmundmiller Jun 4, 2021
a244b54
test: Bump version to 21.04-0
edmundmiller Jun 10, 2021
14bdb5f
chore: Add a note to default tests only supporting docker
edmundmiller Jun 10, 2021
14eaea7
ci: Use parameters in job names
edmundmiller Jun 10, 2021
6ed824f
test(star_salmon): Add missing tests
edmundmiller Jun 10, 2021
a68e9f5
ci: Fix salmon params
edmundmiller Jun 10, 2021
a2d0a37
test(quantify_salmon): Fix path
edmundmiller Jun 10, 2021
f600692
ci: Upload logs on failure
edmundmiller Jun 10, 2021
b0c92e4
test: Load default nextflow.config
edmundmiller Jun 10, 2021
0e8f245
test: Add modules config include back in
edmundmiller Jun 10, 2021
8ee3524
test(star_salmon): Fix tag
edmundmiller Jun 10, 2021
5275ced
test: Remove all ` in test names
edmundmiller Jun 10, 2021
b2aa206
test: Add modules clone step
edmundmiller Jun 10, 2021
5a4fb66
test: Remove -- in test names
edmundmiller Jun 10, 2021
dd96ef5
test(quantify_salmon): Actually call a value
edmundmiller Jun 10, 2021
8a74e46
ci: Update Local modules to triggers
edmundmiller Jun 10, 2021
faa22a6
test(star_salmon): Mark remove_ribo_rna as failing
edmundmiller Jun 10, 2021
40b93de
test(quant_rsem): Add default test
edmundmiller Jun 10, 2021
617773a
test: Mark subworkflows as failing
edmundmiller Jun 11, 2021
32f2ad2
test(default): Add expected files and their md5sums
edmundmiller Jun 11, 2021
9554d2a
Merge remote-tracking branch 'origin/dev' into pytest-workflow
grst Dec 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
195 changes: 156 additions & 39 deletions .github/workflows/ci.yml
Expand Up @@ -23,11 +23,11 @@ jobs:
# Nextflow versions
include:
# Test pipeline minimum Nextflow version
- NXF_VER: '21.10.3'
NXF_EDGE: ''
- NXF_VER: "21.10.3"
NXF_EDGE: ""
# Test latest edge release of Nextflow
- NXF_VER: ''
NXF_EDGE: '1'
- NXF_VER: ""
NXF_EDGE: "1"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
Expand All @@ -42,29 +42,45 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- name: Run pipeline with test data
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install --upgrade pip pytest-workflow

- name: Run pipeline with default settings
run: pytest --tag default --kwdof

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-default-${{ matrix.nxf_version }}
path: |
/tmp/pytest_workflow_*/*/.nextflow.log
/tmp/pytest_workflow_*/*/log.out
/tmp/pytest_workflow_*/*/log.err

star_salmon:
name: Test STAR Salmon with workflow parameters
name: Test STAR Salmon with ${{ matrix.parameters }}
Comment on lines -50 to +66
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a separate star_salmon for this? Couldn't this just be another entry in the matrix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be another entry in the matrix, I was thinking this was a good interim to make sure we didn't miss anything in the conversion.

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"
- "skip_qc"
- "remove_ribo_rna"
- "skip_trimming"
- "gtf false"
- "star_index false"
- "transcript_fasta"
- "min_mapped_reads 90"
- "with_umi"
- "skip_trimming"
- "bam_csi_index"
- "save_reference"
- "featurecounts_group_type"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
Expand All @@ -74,19 +90,35 @@ jobs:
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 }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install --upgrade pip pytest-workflow

- name: Run pipeline with STAR Salmon and ${{ matrix.parameters }}
run: pytest --tag star --tag salmon --tag "${{ matrix.parameters }}" --kwdof

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-star_salmon-${{ matrix.parameters }}-${{ matrix.nxf_version }}
path: |
/tmp/pytest_workflow_*/*/.nextflow.log
/tmp/pytest_workflow_*/*/log.out
/tmp/pytest_workflow_*/*/log.err

star_rsem:
name: Test STAR RSEM with workflow parameters
name: Test STAR RSEM with ${{ matrix.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"
- "skip_qc"
- "rsem_index false"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
Expand All @@ -96,19 +128,35 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- name: Run pipeline with RSEM STAR and various parameters
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner star_rsem ${{ matrix.parameters }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install --upgrade pip pytest-workflow

- name: Run pipeline with STAR RSEM and ${{ matrix.parameters }}
run: pytest --tag star --tag rsem --tag "${{ matrix.parameters }}" --kwdof

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-star_rsem-${{ matrix.parameters }}-${{ matrix.nxf_version }}
path: |
/tmp/pytest_workflow_*/*/.nextflow.log
/tmp/pytest_workflow_*/*/log.out
/tmp/pytest_workflow_*/*/log.err

hisat2:
name: Test HISAT2 with workflow parameters
name: Test HISAT2 with ${{ matrix.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"
- "skip_qc"
- "hisat2_index false"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
Expand All @@ -118,19 +166,35 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- name: Run pipeline with HISAT2 and various parameters
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --aligner hisat2 ${{ matrix.parameters }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install --upgrade pip pytest-workflow

- name: Run pipeline with HISAT2 ${{ matrix.parameters }}
run: pytest --tag hisat2 --tag "${{ matrix.parameters }}" --kwdof

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-hisat2-${{ matrix.parameters }}-${{ matrix.nxf_version }}
path: |
/tmp/pytest_workflow_*/*/.nextflow.log
/tmp/pytest_workflow_*/*/log.out
/tmp/pytest_workflow_*/*/log.err

salmon:
name: Test Salmon with workflow parameters
name: Test Salmon with ${{ matrix.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"
- "skip_qc skip_alignment"
- "salmon_index false transcript_fasta false"
steps:
- name: Check out pipeline code
uses: actions/checkout@v2
Expand All @@ -140,6 +204,59 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install --upgrade pip pytest-workflow

- name: Run pipeline with Salmon and various parameters
run: pytest --tag salmon --tag "${{ matrix.parameters }}" --kwdof

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-salmon-${{ matrix.parameters }}-${{ matrix.nxf_version }}
path: |
/tmp/pytest_workflow_*/*/.nextflow.log
/tmp/pytest_workflow_*/*/log.out
/tmp/pytest_workflow_*/*/log.err

sra_download:
name: Test downloading of public data
if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/rnaseq') }}
runs-on: ubuntu-latest
env:
NXF_VER: ${{ matrix.nxf_ver }}
NXF_ANSI_LOG: false
steps:
- name: Check out pipeline code
uses: actions/checkout@v2

- name: Install Nextflow
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --pseudo_aligner salmon ${{ matrix.parameters }}
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install --upgrade pip pytest-workflow

- name: Run pipeline to download public data
continue-on-error: true
run: pytest --tag sra_download --kwdof

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-sra_download-${{ matrix.nxf_version }}
path: |
/tmp/pytest_workflow_*/*/.nextflow.log
/tmp/pytest_workflow_*/*/log.out
/tmp/pytest_workflow_*/*/log.err
106 changes: 106 additions & 0 deletions .github/workflows/local_modules.yml
@@ -0,0 +1,106 @@
name: Local Modules pytest-workflow
on:
push:
branches:
- dev
pull_request:
release:
types: [published]

jobs:
changes:
name: Check for changes
runs-on: ubuntu-latest
outputs:
# Expose matched filters as job 'modules' output variable
modules: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: 'tests/config/pytest_software.yml'

test:
runs-on: ubuntu-latest
name: ${{ matrix.tags }} ${{ matrix.profile }} ${{ matrix.nxf_version }}
needs: changes
if: needs.changes.outputs.modules != '[]'
strategy:
fail-fast: false
matrix:
nxf_version: ['21.04.0-edge']
tags: ['${{ fromJson(needs.changes.outputs.modules) }}']
profile: ['docker', 'singularity'] ## 'conda'
env:
NXF_ANSI_LOG: false
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install Python dependencies
run: python -m pip install --upgrade pip pytest-workflow

- uses: actions/cache@v2
with:
path: /usr/local/bin/nextflow
key: ${{ runner.os }}-nextflow-${{ matrix.nxf_version }}
restore-keys: |
${{ runner.os }}-nextflow-

- name: Install Nextflow
env:
NXF_VER: ${{ matrix.nxf_version }}
CAPSULE_LOG: none
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: Setup 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

# Test the module
- name: Run pytest-workflow
# only use one thread for pytest-workflow to avoid race condition on conda cache.
run: TMPDIR=~ PROFILE=${{ matrix.profile }} pytest --tag ${{ matrix.tags }} --symlink --kwdof

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v2
with:
name: logs-${{ matrix.tags }}-${{ matrix.profile }}-${{ matrix.nxf_version }}
path: |
/home/runner/pytest_workflow_*/*/.nextflow.log
/home/runner/pytest_workflow_*/*/log.out
/home/runner/pytest_workflow_*/*/log.err