diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9643b84..13a7bed 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,8 +8,8 @@ "esbenp.prettier-vscode", "redhat.vscode-yaml", "GitHub.vscode-pull-request-github", - "github.vscode-github-actions", - ], - }, - }, + "github.vscode-github-actions" + ] + } + } } diff --git a/README.md b/README.md index de0e480..39b9a69 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/main.nf b/main.nf index dc3dc2a..22e95b2 100644 --- a/main.nf +++ b/main.nf @@ -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: @@ -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( diff --git a/tests/main.nf.test b/tests/main.nf.test index 424fe2e..2d6d957 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -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() } + ) } } @@ -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() } + ) } } @@ -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() } + ) } } @@ -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() } + ) } } diff --git a/tests/main.nf.test.snap b/tests/main.nf.test.snap index 87f5480..30e6786 100644 --- a/tests/main.nf.test.snap +++ b/tests/main.nf.test.snap @@ -14,8 +14,8 @@ "errorMessage": "", "trace": { "tasksFailed": 1, - "tasksCount": 12, - "tasksSucceeded": 11 + "tasksCount": 13, + "tasksSucceeded": 12 }, "name": "workflow", "success": true @@ -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": [ @@ -45,8 +49,8 @@ "errorMessage": "", "trace": { "tasksFailed": 1, - "tasksCount": 13, - "tasksSucceeded": 12 + "tasksCount": 14, + "tasksSucceeded": 13 }, "name": "workflow", "success": true @@ -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": [ @@ -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": { @@ -103,8 +115,8 @@ "errorMessage": "", "trace": { "tasksFailed": 1, - "tasksCount": 13, - "tasksSucceeded": 12 + "tasksCount": 14, + "tasksSucceeded": 13 }, "name": "workflow", "success": true @@ -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" } } \ No newline at end of file diff --git a/tests/main.test_bin_script.test b/tests/main.test_bin_script.test index 541384d..6f5dae1 100644 --- a/tests/main.test_bin_script.test +++ b/tests/main.test_bin_script.test @@ -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() } + ) } } diff --git a/tests/main.test_create_file.nf.test b/tests/main.test_create_file.nf.test index 4ec84a9..d937abe 100644 --- a/tests/main.test_create_file.nf.test +++ b/tests/main.test_create_file.nf.test @@ -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() } + ) } } diff --git a/tests/main.test_create_file.nf.test.snap b/tests/main.test_create_file.nf.test.snap index a9e0079..80e1693 100644 --- a/tests/main.test_create_file.nf.test.snap +++ b/tests/main.test_create_file.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_CREATE_FILE": { "content": [ { "0": [ @@ -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" } } \ No newline at end of file diff --git a/tests/main.test_create_folder.nf.test b/tests/main.test_create_folder.nf.test index e92031e..4b9456e 100644 --- a/tests/main.test_create_folder.nf.test +++ b/tests/main.test_create_folder.nf.test @@ -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() } + ) } } diff --git a/tests/main.test_create_folder.nf.test.snap b/tests/main.test_create_folder.nf.test.snap index 9342c07..efb35c6 100644 --- a/tests/main.test_create_folder.nf.test.snap +++ b/tests/main.test_create_folder.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_CREATE_FOLDER": { "content": [ { "0": [ @@ -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" } } \ No newline at end of file diff --git a/tests/main.test_ignore_fail.test b/tests/main.test_ignore_fail.test index 0927524..c488c54 100644 --- a/tests/main.test_ignore_fail.test +++ b/tests/main.test_ignore_fail.test @@ -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 } + ) } } diff --git a/tests/main.test_input.nf.test b/tests/main.test_input.nf.test index 7701fc8..3a72a0a 100644 --- a/tests/main.test_input.nf.test +++ b/tests/main.test_input.nf.test @@ -4,7 +4,7 @@ nextflow_process { script "main.nf" process "TEST_INPUT" - test("Should run without failures") { + test("TEST_INPUT") { when { process { @@ -15,8 +15,10 @@ nextflow_process { } then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) } } diff --git a/tests/main.test_input.nf.test.snap b/tests/main.test_input.nf.test.snap index a191682..cae0563 100644 --- a/tests/main.test_input.nf.test.snap +++ b/tests/main.test_input.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_INPUT": { "content": [ { "0": [ @@ -7,6 +7,10 @@ ] } ], - "timestamp": "2023-10-04T11:56:21.166077" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:23.807701" } } \ No newline at end of file diff --git a/tests/main.test_mv_file.nf.test b/tests/main.test_mv_file.nf.test index c6651c1..ca3db2f 100644 --- a/tests/main.test_mv_file.nf.test +++ b/tests/main.test_mv_file.nf.test @@ -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() } + ) } } diff --git a/tests/main.test_mv_file.nf.test.snap b/tests/main.test_mv_file.nf.test.snap index 9229b6a..ef3beec 100644 --- a/tests/main.test_mv_file.nf.test.snap +++ b/tests/main.test_mv_file.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_MV_FILE": { "content": [ { "0": [ @@ -7,6 +7,10 @@ ] } ], - "timestamp": "2023-10-04T11:56:19.102784" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:21.768791" } } \ No newline at end of file diff --git a/tests/main.test_mv_folder_contents.nf.test b/tests/main.test_mv_folder_contents.nf.test index 9a30d5c..681cbd3 100644 --- a/tests/main.test_mv_folder_contents.nf.test +++ b/tests/main.test_mv_folder_contents.nf.test @@ -4,11 +4,13 @@ nextflow_process { script "main.nf" process "TEST_MV_FOLDER_CONTENTS" - test("Should run without failures") { + test("TEST_MV_FOLDER_CONTENTS") { then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) } } diff --git a/tests/main.test_mv_folder_contents.nf.test.snap b/tests/main.test_mv_folder_contents.nf.test.snap index e518bb9..3d0d1cc 100644 --- a/tests/main.test_mv_folder_contents.nf.test.snap +++ b/tests/main.test_mv_folder_contents.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_MV_FOLDER_CONTENTS": { "content": [ { "0": [ @@ -14,6 +14,10 @@ ] } ], - "timestamp": "2023-10-04T12:19:57.98459" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:19.746587" } } \ No newline at end of file diff --git a/tests/main.test_pass_file.nf.test b/tests/main.test_pass_file.nf.test index d9226f5..c29dd53 100644 --- a/tests/main.test_pass_file.nf.test +++ b/tests/main.test_pass_file.nf.test @@ -4,7 +4,7 @@ nextflow_process { script "main.nf" process "TEST_PASS_FILE" - test("Should run without failures") { + test("TEST_PASS_FILE") { when { process { @@ -15,8 +15,10 @@ nextflow_process { } then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) } } diff --git a/tests/main.test_pass_file.nf.test.snap b/tests/main.test_pass_file.nf.test.snap index 27eba1e..a3bae0f 100644 --- a/tests/main.test_pass_file.nf.test.snap +++ b/tests/main.test_pass_file.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_PASS_FILE": { "content": [ { "0": [ @@ -10,6 +10,10 @@ ] } ], - "timestamp": "2023-10-04T11:56:24.966198" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:28.094518" } } \ No newline at end of file diff --git a/tests/main.test_pass_folder.nf.test b/tests/main.test_pass_folder.nf.test index c3610fb..702056f 100644 --- a/tests/main.test_pass_folder.nf.test +++ b/tests/main.test_pass_folder.nf.test @@ -4,7 +4,7 @@ nextflow_process { script "main.nf" process "TEST_PASS_FOLDER" - test("Should run without failures") { + test("TEST_PASS_FOLDER") { when { process { @@ -19,8 +19,10 @@ nextflow_process { } then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) } } diff --git a/tests/main.test_pass_folder.nf.test.snap b/tests/main.test_pass_folder.nf.test.snap index b2fc621..6a56ae3 100644 --- a/tests/main.test_pass_folder.nf.test.snap +++ b/tests/main.test_pass_folder.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_PASS_FOLDER": { "content": [ { "0": [ @@ -14,6 +14,10 @@ ] } ], - "timestamp": "2023-10-04T12:19:55.945452" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:17.775111" } } \ No newline at end of file diff --git a/tests/main.test_publish_file.nf.test b/tests/main.test_publish_file.nf.test index fa53810..8954ce1 100644 --- a/tests/main.test_publish_file.nf.test +++ b/tests/main.test_publish_file.nf.test @@ -4,11 +4,13 @@ nextflow_process { script "main.nf" process "TEST_PUBLISH_FILE" - test("Should run without failures") { + test("TEST_PUBLISH_FILE") { then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) } } diff --git a/tests/main.test_publish_file.nf.test.snap b/tests/main.test_publish_file.nf.test.snap index 91bd257..316b6ec 100644 --- a/tests/main.test_publish_file.nf.test.snap +++ b/tests/main.test_publish_file.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_PUBLISH_FILE": { "content": [ { "0": [ @@ -7,6 +7,10 @@ ] } ], - "timestamp": "2023-10-04T11:56:23.047403" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:25.923767" } } \ No newline at end of file diff --git a/tests/main.test_publish_folder.nf.test b/tests/main.test_publish_folder.nf.test index 8cf02cf..72eb024 100644 --- a/tests/main.test_publish_folder.nf.test +++ b/tests/main.test_publish_folder.nf.test @@ -4,11 +4,13 @@ nextflow_process { script "main.nf" process "TEST_PUBLISH_FOLDER" - test("Should run without failures") { + test("TEST_PUBLISH_FOLDER") { then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) } } diff --git a/tests/main.test_publish_folder.nf.test.snap b/tests/main.test_publish_folder.nf.test.snap index ff99057..02e5454 100644 --- a/tests/main.test_publish_folder.nf.test.snap +++ b/tests/main.test_publish_folder.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_PUBLISH_FOLDER": { "content": [ { "0": [ @@ -10,6 +10,10 @@ ] } ], - "timestamp": "2023-10-04T11:56:26.981311" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:30.136869" } } \ No newline at end of file diff --git a/tests/main.test_stage_remote.test b/tests/main.test_stage_remote.test index 219fcc3..f151087 100644 --- a/tests/main.test_stage_remote.test +++ b/tests/main.test_stage_remote.test @@ -4,7 +4,7 @@ nextflow_process { script "main.nf" process "TEST_STAGE_REMOTE" - test("Should run without failures") { + test("TEST_STAGE_REMOTE") { when { @@ -20,8 +20,10 @@ nextflow_process { } then { - assert process.success - assert snapshot(process.out).match() + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) } } diff --git a/tests/main.test_success.nf.test b/tests/main.test_success.nf.test index c35362a..c78481e 100644 --- a/tests/main.test_success.nf.test +++ b/tests/main.test_success.nf.test @@ -4,13 +4,15 @@ nextflow_process { script "main.nf" process "TEST_SUCCESS" - test("Should run without failures") { + test("TEST_SUCCESS") { then { - assert process.success - assert process.exitStatus == 0 - assert process.trace.tasks().size() == 1 - assert snapshot(process).match() + assertAll( + { assert process.success }, + { assert process.exitStatus == 0 }, + { assert process.trace.tasks().size() == 1 }, + { assert snapshot(process).match() } + ) } } diff --git a/tests/main.test_success.nf.test.snap b/tests/main.test_success.nf.test.snap index 610d5f4..5d9f1a8 100644 --- a/tests/main.test_success.nf.test.snap +++ b/tests/main.test_success.nf.test.snap @@ -1,5 +1,5 @@ { - "Should run without failures": { + "TEST_SUCCESS": { "content": [ { "stderr": [ @@ -26,6 +26,10 @@ "success": true } ], - "timestamp": "2023-10-04T12:20:24.512086" + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-04-18T17:19:40.583688" } } \ No newline at end of file