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

Add pipeline-level nf-tests #14

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 1 addition & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,6 @@ concurrency:

jobs:
test:
name: Run pipeline with test data
# Only run on push if this is the nf-aggregate dev branch (merged PRs)
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'seqeralabs/nf-aggregate') }}"
runs-on: ubuntu-latest
env:
TOWER_ACCESS_TOKEN: ${{ secrets.TOWER_ACCESS_TOKEN }}
strategy:
matrix:
NXF_VER:
- "23.10.0"
- "latest-everything"
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- 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

changes:
name: Check for changes
runs-on: ubuntu-latest
Expand Down Expand Up @@ -69,6 +45,7 @@ jobs:
fail-fast: false
matrix:
NXF_VER:
- "23.10.0"
- "latest-everything"
tags: ["${{ fromJson(needs.changes.outputs.tags) }}"]
profile:
Expand Down
23 changes: 23 additions & 0 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
nextflow_pipeline {

name "Test Workflow main.nf"
script "../main.nf"

tag "pipeline"
tag "pipeline_nf-aggregate"

test("Should run without failures") {

when {
params {
outdir = "results"
}
}

then {
assert workflow.success
}

}

}
5 changes: 5 additions & 0 deletions tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pipeline_nf-aggregate:
Copy link
Member

Choose a reason for hiding this comment

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

Can we put this file in the workflows/nf_aggregate/ folder instead so everything is self-enclosed.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, these tests are referencing the main.nf in the root, so it's a pipeline-level one. I think we should probably have another one in the folder you indicate. At least nf-test docs reference both 'pipeline' and 'workflow' level tests, though I'm not sure what the value of both is.

Copy link
Member

Choose a reason for hiding this comment

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

Ok. I'll move as required. Thanks!

- "**.nf"
- "**.config"
- "**.nf.test"
- "**.json"