Skip to content

Commit

Permalink
Set up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Aratz committed May 3, 2024
1 parent fbfb02d commit 8a19929
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ results/
testing/
testing*
*.pyc
.nf-test
8 changes: 8 additions & 0 deletions nf-test.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config {

testsDir "tests"
workDir ".nf-test"
configFile "tests/nextflow.config"
profile "test,docker"

}
20 changes: 20 additions & 0 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
nextflow_pipeline {

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

test("Should run without failures") {

when {
params {
outdir = "tests/results"
}
}

then {
assert workflow.success
}

}

}
5 changes: 5 additions & 0 deletions tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/*
========================================================================================
Nextflow config file for running tests
========================================================================================
*/
30 changes: 30 additions & 0 deletions tests/workflows/seqinspector.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
nextflow_workflow {

name "Test Workflow SEQINSPECTOR"
script "workflows/seqinspector.nf"
workflow "SEQINSPECTOR"

test("Should run without failures pipeline") {

when {
params {
// define parameters here. Example:
// outdir = "tests/results"
}
workflow {
"""
// define inputs of the workflow here. Example:
// input[0] = file("https://raw.githubusercontent.com/nf-core/test-datasets/e47966b63444ec0fcdef23bfc410eeca22535ac7/testdata/MiSeq/samplesheet.csv")
input[0] = file("assets/samplesheet.csv")
"""
}
}

then {
assert workflow.success
assert snapshot(workflow.out).match()
}

}

}

0 comments on commit 8a19929

Please sign in to comment.