Skip to content

Add nf-test #366

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

Merged
merged 55 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
6757207
Add nf-test skeleton
jfy133 Apr 24, 2024
6f71094
Deactivate check CI structure during linting
jfy133 Apr 24, 2024
998de1f
Implement nf-test for BGC workflow
jasmezz May 7, 2024
c9db992
Implemented nf-test for AMP/ARG workflows (pyrodigal)
jasmezz May 7, 2024
8d909fb
Complete test_pyrodigal
jasmezz May 8, 2024
3effa9f
Merge branch 'nf-test-conversion' of https://github.com/nf-core/funcs…
Darcy220606 May 17, 2024
dcadba5
Fix test_pyrodigal, add test_prokka
jasmezz May 22, 2024
fb6363f
Merge branch 'nf-test-conversion' of https://github.com/nf-core/funcs…
Darcy220606 May 27, 2024
2725c09
add taxonomy nftest
Darcy220606 May 27, 2024
f61f051
Add test_bakta
jasmezz May 28, 2024
eb4556b
Update test_bakta
jasmezz May 28, 2024
5c4ab48
Fix snapshots
jasmezz Jun 12, 2024
0c8c1a4
Merge branch 'dev' into nf-test-conversion
jasmezz Jun 13, 2024
3df0b1a
Fix test profiles
jasmezz Jun 13, 2024
719f83c
Update ci.yml, changelog, multiqc, schema.json, fix linting
jasmezz Jun 13, 2024
c39a979
Fix funcscan.nf, ci.yml
jasmezz Jun 13, 2024
fad47e1
Fix linting for nextflow_schema.json
jasmezz Jun 13, 2024
7673f80
Update paths (test_bgc_pyrodigal)
jasmezz Jun 19, 2024
42a849a
Merge branch 'dev' into nf-test-conversion
jfy133 Jun 23, 2024
afdec7a
Merge branch 'nf-test-conversion' of github.com:nf-core/funcscan into…
jfy133 Jun 23, 2024
0c552c1
Standard test-data specification across all new configs
jfy133 Jun 23, 2024
d96a513
Update schema (until fargene), update some tests
jasmezz Jun 24, 2024
f036b99
Finish pyrodigal and prokka tests, update schema
jasmezz Jun 25, 2024
96bb450
Deactivate hmmsearch by default, update MultiQC
jasmezz Jun 26, 2024
516bce1
Finish taxonomy (bakta,prokka,pyrodigal) and bakta tests, update full…
jasmezz Jun 26, 2024
6f187e3
Update `annotation_bakta_db` param, add preannotated test (not workin…
jasmezz Jun 26, 2024
3d5876a
Complete full test
jasmezz Jun 28, 2024
8755057
Unify all "database" parameters
jasmezz Jun 28, 2024
b19f7e2
Fix database params
jasmezz Jul 1, 2024
fc22654
Fix full test
jasmezz Jul 2, 2024
ab0a22d
Fix linting
jasmezz Jul 2, 2024
4f756aa
Finish full test
jasmezz Jul 3, 2024
4bdff2c
Add preannotated tests
jasmezz Jul 3, 2024
000bb90
Merge branch 'dev' into nf-test-conversion
jasmezz Jul 3, 2024
1f617a5
Fix linting/missed merge conflict
jasmezz Jul 3, 2024
bad36bc
Update taxonomy tests, update ci.yml
jasmezz Jul 4, 2024
98c71b8
Merge branch 'dev' into nf-test-conversion
jasmezz Jul 4, 2024
83841c5
Update changelog
jasmezz Jul 4, 2024
088dbce
Merge branch 'nf-test-conversion' of github.com:nf-core/funcscan into…
jasmezz Jul 4, 2024
af6b1fb
Fix preannotated test
jasmezz Jul 4, 2024
6065c28
Updated failing taxonomy tests (snapshots missing)
jasmezz Jul 4, 2024
22ad445
Add taxonomy_bakta snapshot
jasmezz Jul 5, 2024
453c6a0
Add taxonomy_prokka snapshot
jasmezz Jul 5, 2024
50ce8d5
Merge branch 'dev' into nf-test-conversion
jasmezz Jul 5, 2024
746bbfa
Update changelog
jasmezz Jul 5, 2024
829c0e0
Update preannotated test + snapshot
jasmezz Jul 5, 2024
a0a5c9d
Remove deprecated ampcombi module
jasmezz Jul 5, 2024
48cb25e
Fix linting, fix warning messages if no annotation files
jasmezz Jul 5, 2024
e305c57
Apply suggestions from code review
jasmezz Jul 5, 2024
98a69ab
Merge branch 'dev' into nf-test-conversion
jasmezz Jul 8, 2024
ed9f265
Merge branch 'dev' into nf-test-conversion
jfy133 Jul 8, 2024
ab3eda5
Clean up and add missing version numbers to CHANGELOG
jfy133 Jul 8, 2024
0789878
Apply suggestions from code review [skip ci]
jasmezz Jul 8, 2024
33f55b5
Apply suggestions from code review
jasmezz Jul 9, 2024
5c1c275
update test_full snap
Darcy220606 Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 55 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,67 @@
name: nf-core CI
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
name: nf-core CI
on:
push:
branches:
- dev
- "dev"
pull_request:
branches:
- "dev"
- "master"
release:
types: [published]
types:
- "published"

env:
NXF_ANSI_LOG: false
NFTEST_VER: "0.7.3" # We tested with 0.8.4 - should we also change that here??

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test:
name: Run pipeline with test data (AMP and ARG workflows)
# 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/funcscan') }}"
define_nxf_versions:
name: Choose nextflow versions to test against depending on target branch
runs-on: ubuntu-latest
strategy:
matrix:
NXF_VER:
- "23.04.0"
- "latest-everything"
parameters:
- "--annotation_tool prodigal"
- "--annotation_tool prokka"
- "--annotation_tool bakta --annotation_bakta_db_downloadtype light --arg_skip_deeparg --arg_skip_amrfinderplus" # Skip deeparg and amrfinderplus due to otherwise running out of space on GitHub Actions

outputs:
matrix: ${{ steps.nxf_versions.outputs.matrix }}
steps:
- name: Check out pipeline code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

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

- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run pipeline with test data (AMP and ARG workflows)
- id: nxf_versions
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results ${{ matrix.parameters }}
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.base_ref }}" == "dev" && "${{ matrix.NXF_VER }}" != "latest-everything" ]]; then
echo matrix='["latest-everything"]' | tee -a $GITHUB_OUTPUT
else
echo matrix='["latest-everything", "23.10.0"]' | tee -a $GITHUB_OUTPUT
fi

test_bgc:
name: Run pipeline with test data (BGC workflow)
# 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/funcscan') }}"
test:
name: nf-test
needs: define_nxf_versions
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
NXF_VER:
- "23.04.0"
- "latest-everything"
parameters:
- "--annotation_tool prodigal"
- "--annotation_tool prokka"
- "--annotation_tool bakta --annotation_bakta_db_downloadtype light"
NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }}
tags:
- "test_nothing"
- "test_taxonomy_pyrodigal"
- "test_taxonomy_bakta"
- "test_taxonomy_prokka"
profile:
- "docker"

steps:
- name: Check out pipeline code
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Check out test data
uses: actions/checkout@v3
with:
repository: nf-core/test-datasets
ref: funcscan
path: test-datasets/
fetch-depth: 1

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
Expand All @@ -74,37 +71,23 @@ jobs:
- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run pipeline with test data (BGC workflow)
- name: Install nf-test
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test_bgc,docker --outdir ./results ${{ matrix.parameters }} --bgc_skip_deepbgc
wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER
sudo mv nf-test /usr/local/bin/

test_taxonomy:
name: Run pipeline with test data (AMP, ARG and BGC taxonomy workflows)
# 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/funcscan') }}"
runs-on: ubuntu-latest
strategy:
matrix:
NXF_VER:
- "23.04.0"
- "latest-everything"
parameters:
- "--annotation_tool prodigal"
- "--annotation_tool prokka"
- "--annotation_tool bakta --annotation_bakta_db_downloadtype light"
- name: Run nf-test
run: |
nf-test test --tag ${{ matrix.tags }} --profile ${{ matrix.tags }},${{ matrix.profile }} --junitxml=test.xml

steps:
- name: Check out pipeline code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Output log on failure
if: failure()
run: |
sudo apt install bat > /dev/null
batcat --decorations=always --color=always ${{ github.workspace }}/.nf-test/tests/*/output/pipeline_info/software_versions.yml

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
version: "${{ matrix.NXF_VER }}"

- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run pipeline with test data (AMP, ARG and BGC taxonomy workflows)
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test_taxonomy,docker --outdir ./results ${{ matrix.parameters }}
report_paths: "*.xml"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ results/
testing/
testing*
*.pyc
.nf-test/
.nf-test*
3 changes: 3 additions & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
repository_type: pipeline
## TODO: re-activate once nf-test ci.yml structure updated
lint:
actions_ci: False
9 changes: 4 additions & 5 deletions conf/test.config → conf/test_bakta.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/funcscan -profile test,<docker/singularity> --outdir <OUTDIR>
nextflow run nf-core/funcscan -profile test_bakta,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'Test profile'
config_profile_name = 'AMP/ARG Bakta test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
Expand All @@ -21,12 +21,11 @@ params {

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv'
amp_hmmsearch_models = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/hmms/mybacteriocin.hmm'

annotation_tool = 'prodigal'
annotation_tool = 'bakta'

run_arg_screening = true
arg_fargene_hmmmodel = 'class_a,class_b_1_2'

run_amp_screening = true
amp_hmmsearch_models = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/hmms/mybacteriocin.hmm'
}
29 changes: 29 additions & 0 deletions conf/test_bgc_bakta.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/funcscan -profile test_bgc_bakta,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'BGC Bakta test profile'
config_profile_description = 'Minimal test dataset to check BGC workflow function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '8.GB'
max_time = '6.h'

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv'
annotation_tool = 'bakta'
annotation_bakta_db_downloadtype = "light"

run_bgc_screening = true
bgc_hmmsearch_models = 'https://raw.githubusercontent.com/antismash/antismash/fd61de057e082fbf071732ac64b8b2e8883de32f/antismash/detection/hmm_detection/data/ToyB.hmm'
}
11 changes: 4 additions & 7 deletions conf/test_bgc.config → conf/test_bgc_prokka.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/funcscan -profile test_bgc,<docker/singularity> --outdir <OUTDIR>
nextflow run nf-core/funcscan -profile test_bgc_prokka,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'BGC test profile'
config_profile_name = 'BGC Prokka test profile'
config_profile_description = 'Minimal test dataset to check BGC workflow function'

// Limit resources so that this can run on GitHub Actions
Expand All @@ -21,11 +21,8 @@ params {

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv'
bgc_hmmsearch_models = 'https://raw.githubusercontent.com/antismash/antismash/fd61de057e082fbf071732ac64b8b2e8883de32f/antismash/detection/hmm_detection/data/ToyB.hmm'

annotation_tool = 'prodigal'
annotation_tool = 'prokka'

run_arg_screening = false
run_amp_screening = false
run_bgc_screening = true
bgc_hmmsearch_models = 'https://raw.githubusercontent.com/antismash/antismash/fd61de057e082fbf071732ac64b8b2e8883de32f/antismash/detection/hmm_detection/data/ToyB.hmm'
}
28 changes: 28 additions & 0 deletions conf/test_bgc_pyrodigal.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/funcscan -profile test_bgc_pyrodigal,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'BGC Pyrodigal test profile'
config_profile_description = 'Minimal test dataset to check BGC workflow function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '8.GB'
max_time = '6.h'

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv'
annotation_tool = 'pyrodigal'

run_bgc_screening = true
bgc_hmmsearch_models = 'https://raw.githubusercontent.com/antismash/antismash/fd61de057e082fbf071732ac64b8b2e8883de32f/antismash/detection/hmm_detection/data/ToyB.hmm'
}
31 changes: 31 additions & 0 deletions conf/test_prokka.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/funcscan -profile test_prokka,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'AMP/ARG Prokka test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '8.GB'
max_time = '6.h'

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv'
annotation_tool = 'prokka'

run_arg_screening = true
arg_fargene_hmmmodel = 'class_a,class_b_1_2'

run_amp_screening = true
amp_hmmsearch_models = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/hmms/mybacteriocin.hmm'
}
31 changes: 31 additions & 0 deletions conf/test_pyrodigal.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nextflow config file for running minimal tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Defines input files and everything required to run a fast and simple pipeline test.

Use as follows:
nextflow run nf-core/funcscan -profile test_pyrodigal,<docker/singularity> --outdir <OUTDIR>

----------------------------------------------------------------------------------------
*/

params {
config_profile_name = 'AMP/ARG Pyrodigal test profile'
config_profile_description = 'Minimal test dataset to check pipeline function'

// Limit resources so that this can run on GitHub Actions
max_cpus = 2
max_memory = '8.GB'
max_time = '6.h'

// Input data
input = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/samplesheet_reduced.csv'
annotation_tool = 'pyrodigal'

run_arg_screening = true
arg_fargene_hmmmodel = 'class_a,class_b_1_2'

run_amp_screening = true
amp_hmmsearch_models = 'https://raw.githubusercontent.com/nf-core/test-datasets/funcscan/hmms/mybacteriocin.hmm'
}
Loading