Skip to content

Commit

Permalink
Update tests and GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Apr 18, 2024
1 parent 923014a commit 14e7065
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 101 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/ci.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Test

on:
push:
branches:
- master
- dev
- test-refactor
pull_request:
branches:
- master

jobs:
pipeline-test:
name: Pipeline tests
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
profile:
- gemflux
- starrsem
- starflux
- markdup
- rmdup
- ihec

steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 16
java-package: jre
- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
- name: Install nf-test
uses: nf-core/setup-nf-test@v1
- name: Run tests
run: nf-test test --tag pipeline --profile +${CI_PROFILE}
env:
CI_PROFILE: ${{ matrix.profile }}

workflow-test:
name: Workflow tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 16
java-package: jre
- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
- name: Install nf-test
uses: nf-core/setup-nf-test@v1
- name: Run tests
run: nf-test test --tag workflow

module-test:
name: Module tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 16
java-package: jre
- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
- name: Install nf-test
uses: nf-core/setup-nf-test@v1
- name: Run tests
run: nf-test test --tag module
Binary file added data/annotation.gtf.gz
Binary file not shown.
Binary file added data/genome.fa.gz
Binary file not shown.
29 changes: 0 additions & 29 deletions tests/grape-pipeline-markdup.nf.test

This file was deleted.

29 changes: 0 additions & 29 deletions tests/grape-pipeline-starrsem.nf.test

This file was deleted.

37 changes: 37 additions & 0 deletions tests/grape-pipeline.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import com.askimed.nf.test.util.AnsiColors;
import com.askimed.nf.test.util.AnsiText;

nextflow_pipeline {

name "Test Workflow grape-pipeline.nf"
script "grape-pipeline.nf"

tag "pipeline"

test("Should run pipeline") {

setup {
def profile = parent.profiles.last().minus('+')
print "(${AnsiColors.yellow(profile)}) "
}

then {
def profile = parent.profiles.last().minus('+')
def expected = [
"starrsem": [ traceSize: 28, dbSize: 30 ],
"starflux": [ traceSize: 24, dbSize: 28 ],
"markdup": [ traceSize: 31, dbSize: 30 ],
"gemflux": [ traceSize: 24, dbSize: 22 ],
"rmdup": [ traceSize: 31, dbSize: 30 ],
"ihec": [ traceSize: 31, dbSize: 30 ],
][profile]
assert workflow.success
assert workflow.trace.failed().size() == 0
assert workflow.trace.succeeded().size() == expected?.traceSize
def lines = file("${launchDir}/pipeline.db").readLines()
assert lines.size() == expected?.dbSize
}

}

}
2 changes: 2 additions & 0 deletions tests/modules/fastaIndex/samtools/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ nextflow_process {
script "modules/fastaIndex/samtools/main.nf"
process "fastaIndex"

tag "module"

test("Should produce the fasta index") {

when {
Expand Down
4 changes: 3 additions & 1 deletion tests/modules/mapping/star/main.index.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ nextflow_process {
name "Test Process index"
script "modules/mapping/star/main.nf"
process "index"


tag "module"

test("Should index compressed references") {

when {
Expand Down
6 changes: 4 additions & 2 deletions tests/workflows/mapping.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ nextflow_workflow {
script "workflows/mapping.nf"
workflow "mapping"

tag "workflow"

test("Should run STAR mapping sorting with sambamba") {

when {
Expand All @@ -13,7 +15,7 @@ nextflow_workflow {
sortBamTool = "sambamba"
sjOverHang = 100
maxMismatches = 4
maxMultimaps = 10
maxMultimaps = 10
}
workflow {
"""
Expand Down Expand Up @@ -49,7 +51,7 @@ nextflow_workflow {
sortBamTool = "samtools"
sjOverHang = 100
maxMismatches = 4
maxMultimaps = 10
maxMultimaps = 10
}
workflow {
"""
Expand Down

0 comments on commit 14e7065

Please sign in to comment.