Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrtalbot committed Apr 18, 2024
2 parents 2fb3aff + 3d0d980 commit 3a78da3
Show file tree
Hide file tree
Showing 28 changed files with 221 additions and 99 deletions.
8 changes: 4 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"esbenp.prettier-vscode",
"redhat.vscode-yaml",
"GitHub.vscode-pull-request-github",
"github.vscode-github-actions",
],
},
},
"github.vscode-github-actions"
]
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ Tests moving a file within the working directory.

Tests moving the contents of a folder to a new folder within the working directory.

```
### `TEST_VAL_INPUT`

```
Test a process can accept a value as input.
34 changes: 33 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,37 @@ process TEST_MV_FOLDER_CONTENTS {
"""
}

process TEST_STDOUT {
/*
This process should create and capture STDOUT
*/

output:
stdout

script:
"""
"""
}

process TEST_VAL_INPUT {
/*
This process should read in val and echo to STDOUT
*/


input:
val input

output:
stdout

script:
"""
echo $input
"""
}

workflow NF_CANARY {

main:
Expand All @@ -220,7 +251,8 @@ workflow NF_CANARY {
TEST_IGNORED_FAIL()
TEST_MV_FILE()
TEST_MV_FOLDER_CONTENTS()

TEST_VAL_INPUT("Hello World")

// POC of emitting the channel
Channel.empty()
.mix(
Expand Down
48 changes: 28 additions & 20 deletions tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ nextflow_pipeline{
}

then {
assert workflow.success
assert workflow.trace.tasks().size() == 13
assert workflow.trace.succeeded().size() == 12
assert workflow.trace.failed().size() == 1
assert snapshot(workflow, path(params.outdir).list()).match()
assertAll(
{ assert workflow.success },
{ assert workflow.trace.tasks().size() == 14 },
{ assert workflow.trace.succeeded().size() == 13 },
{ assert workflow.trace.failed().size() == 1 },
{ assert snapshot(workflow, path(params.outdir).list()).match() }
)
}

}
Expand All @@ -33,11 +35,13 @@ nextflow_pipeline{
}

then {
assert workflow.success
assert workflow.trace.tasks().size() == 12
assert workflow.trace.succeeded().size() == 11
assert workflow.trace.failed().size() == 1
assert snapshot(workflow, path(params.outdir).list()).match()
assertAll(
{ assert workflow.success },
{ assert workflow.trace.tasks().size() == 13 },
{ assert workflow.trace.succeeded().size() == 12 },
{ assert workflow.trace.failed().size() == 1 },
{ assert snapshot(workflow, path(params.outdir).list()).match() }
)
}

}
Expand All @@ -54,11 +58,13 @@ nextflow_pipeline{
}

then {
assert workflow.success
assert workflow.trace.tasks().size() == 1
assert workflow.trace.succeeded().size() == 1
assert workflow.trace.failed().size() == 0
assert snapshot(workflow, path(params.outdir).list()).match()
assertAll(
{ assert workflow.success },
{ assert workflow.trace.tasks().size() == 1 },
{ assert workflow.trace.succeeded().size() == 1 },
{ assert workflow.trace.failed().size() == 0 },
{ assert snapshot(workflow, path(params.outdir).list()).match() }
)
}

}
Expand All @@ -73,11 +79,13 @@ nextflow_pipeline{
}

then {
assert workflow.success
assert workflow.trace.tasks().size() == 13
assert workflow.trace.succeeded().size() == 12
assert workflow.trace.failed().size() == 1
assert snapshot(workflow, path("${launchDir}/output").list()).match()
assertAll(
{ assert workflow.success },
{ assert workflow.trace.tasks().size() == 14 },
{ assert workflow.trace.succeeded().size() == 13 },
{ assert workflow.trace.failed().size() == 1 },
{ assert snapshot(workflow, path("${launchDir}/output").list()).match() }
)
}

}
Expand Down
34 changes: 25 additions & 9 deletions tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"errorMessage": "",
"trace": {
"tasksFailed": 1,
"tasksCount": 12,
"tasksSucceeded": 11
"tasksCount": 13,
"tasksSucceeded": 12
},
"name": "workflow",
"success": true
Expand All @@ -28,7 +28,11 @@
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"timestamp": "2023-10-04T12:09:12.963778"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:10:49.052904"
},
"Should publish to alternative directory": {
"content": [
Expand All @@ -45,8 +49,8 @@
"errorMessage": "",
"trace": {
"tasksFailed": 1,
"tasksCount": 13,
"tasksSucceeded": 12
"tasksCount": 14,
"tasksSucceeded": 13
},
"name": "workflow",
"success": true
Expand All @@ -59,7 +63,11 @@
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"timestamp": "2023-10-04T12:20:22.461185"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:10:53.086666"
},
"Should only run one process": {
"content": [
Expand All @@ -86,6 +94,10 @@

]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2023-10-04T12:17:23.982939"
},
"Should run without failures": {
Expand All @@ -103,8 +115,8 @@
"errorMessage": "",
"trace": {
"tasksFailed": 1,
"tasksCount": 13,
"tasksSucceeded": 12
"tasksCount": 14,
"tasksSucceeded": 13
},
"name": "workflow",
"success": true
Expand All @@ -117,6 +129,10 @@
"test.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"timestamp": "2023-10-04T12:07:58.679961"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:10:47.053474"
}
}
8 changes: 5 additions & 3 deletions tests/main.test_bin_script.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ nextflow_process {
script "main.nf"
process "TEST_BIN_SCRIPT"

test("Should run without failures") {
test("TEST_BIN_SCRIPT") {

then {
assert process.success
assert snapshot(process.out).match()
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}
Expand Down
8 changes: 5 additions & 3 deletions tests/main.test_create_file.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ nextflow_process {
script "main.nf"
process "TEST_CREATE_FILE"

test("Should run without failures") {
test("TEST_CREATE_FILE") {

then {
assert process.success
assert snapshot(process.out).match()
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}
Expand Down
8 changes: 6 additions & 2 deletions tests/main.test_create_file.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Should run without failures": {
"TEST_CREATE_FILE": {
"content": [
{
"0": [
Expand All @@ -10,6 +10,10 @@
]
}
],
"timestamp": "2023-10-04T11:56:41.550158"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:19:44.512229"
}
}
8 changes: 5 additions & 3 deletions tests/main.test_create_folder.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ nextflow_process {
script "main.nf"
process "TEST_CREATE_FOLDER"

test("Should run without failures") {
test("TEST_CREATE_FOLDER") {

then {
assert process.success
assert snapshot(process.out).match()
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}
Expand Down
8 changes: 6 additions & 2 deletions tests/main.test_create_folder.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Should run without failures": {
"TEST_CREATE_FOLDER": {
"content": [
{
"0": [
Expand All @@ -16,6 +16,10 @@
]
}
],
"timestamp": "2023-10-04T11:56:39.696681"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:19:42.631931"
}
}
12 changes: 7 additions & 5 deletions tests/main.test_ignore_fail.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ nextflow_process {
script "main.nf"
process "TEST_IGNORED_FAIL"

test("Should run without failures") {
test("TEST_IGNORED_FAIL") {

then {
assert process.success
assert snapshot(process).match()
assert process.trace.failed().size() == 1
assert process.trace.succeeded().size() == 0
assertAll(
{ assert process.success },
{ assert snapshot(process).match() },
{ assert process.trace.failed().size() == 1 },
{ assert process.trace.succeeded().size() == 0 }
)
}

}
Expand Down
8 changes: 5 additions & 3 deletions tests/main.test_input.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ nextflow_process {
script "main.nf"
process "TEST_INPUT"

test("Should run without failures") {
test("TEST_INPUT") {

when {
process {
Expand All @@ -15,8 +15,10 @@ nextflow_process {
}

then {
assert process.success
assert snapshot(process.out).match()
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}
Expand Down
8 changes: 6 additions & 2 deletions tests/main.test_input.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"Should run without failures": {
"TEST_INPUT": {
"content": [
{
"0": [
"alpha\n"
]
}
],
"timestamp": "2023-10-04T11:56:21.166077"
"meta": {
"nf-test": "0.8.4",
"nextflow": "23.10.1"
},
"timestamp": "2024-04-18T17:19:23.807701"
}
}
8 changes: 5 additions & 3 deletions tests/main.test_mv_file.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ nextflow_process {
script "main.nf"
process "TEST_MV_FILE"

test("Should run without failures") {
test("TEST_MV_FILE") {

then {
assert process.success
assert snapshot(process.out).match()
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}

}
Expand Down
Loading

0 comments on commit 3a78da3

Please sign in to comment.