From a85978198c1ef78b70bfeb0d00e7d03264274223 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Mon, 25 Mar 2024 13:53:32 +0100 Subject: [PATCH 1/5] Add tests for val input --- README.md | 4 ++-- main.nf | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) 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 0a2b427..2efb21c 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( From fedb53f0f717d1cfa3548f42fb7cc3a2802bac7b Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:01:16 +0100 Subject: [PATCH 2/5] prettier --- .devcontainer/devcontainer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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" + ] + } + } } From 818a4874d0a9a9b8f0924232498bc64a9952a4e8 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:04:51 +0100 Subject: [PATCH 3/5] Test fixup --- tests/main.nf.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/main.nf.test b/tests/main.nf.test index 424fe2e..ed0e4f3 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -14,7 +14,7 @@ nextflow_pipeline{ then { assert workflow.success - assert workflow.trace.tasks().size() == 13 + assert workflow.trace.tasks().size() == 14 assert workflow.trace.succeeded().size() == 12 assert workflow.trace.failed().size() == 1 assert snapshot(workflow, path(params.outdir).list()).match() @@ -34,7 +34,7 @@ nextflow_pipeline{ then { assert workflow.success - assert workflow.trace.tasks().size() == 12 + assert workflow.trace.tasks().size() == 13 assert workflow.trace.succeeded().size() == 11 assert workflow.trace.failed().size() == 1 assert snapshot(workflow, path(params.outdir).list()).match() @@ -74,7 +74,7 @@ nextflow_pipeline{ then { assert workflow.success - assert workflow.trace.tasks().size() == 13 + assert workflow.trace.tasks().size() == 14 assert workflow.trace.succeeded().size() == 12 assert workflow.trace.failed().size() == 1 assert snapshot(workflow, path("${launchDir}/output").list()).match() From 21f0af75b36b1492bf288c632a598e526ccbaae3 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:07:45 +0100 Subject: [PATCH 4/5] More test fixup --- tests/main.nf.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/main.nf.test b/tests/main.nf.test index ed0e4f3..3ea9d99 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -15,7 +15,7 @@ nextflow_pipeline{ then { assert workflow.success assert workflow.trace.tasks().size() == 14 - assert workflow.trace.succeeded().size() == 12 + assert workflow.trace.succeeded().size() == 13 assert workflow.trace.failed().size() == 1 assert snapshot(workflow, path(params.outdir).list()).match() } @@ -35,7 +35,7 @@ nextflow_pipeline{ then { assert workflow.success assert workflow.trace.tasks().size() == 13 - assert workflow.trace.succeeded().size() == 11 + assert workflow.trace.succeeded().size() == 12 assert workflow.trace.failed().size() == 1 assert snapshot(workflow, path(params.outdir).list()).match() } @@ -74,7 +74,7 @@ nextflow_pipeline{ then { assert workflow.success - assert workflow.trace.tasks().size() == 14 + 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() From 5a8942fa55c495bf3a1c43e74678e3996e378829 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:12:41 +0100 Subject: [PATCH 5/5] More test fixup again --- tests/main.nf.test | 4 ++-- tests/main.nf.test.snap | 34 +++++++++++++++++++++++++--------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/tests/main.nf.test b/tests/main.nf.test index 3ea9d99..98f5d1c 100644 --- a/tests/main.nf.test +++ b/tests/main.nf.test @@ -74,8 +74,8 @@ nextflow_pipeline{ then { assert workflow.success - assert workflow.trace.tasks().size() == 13 - assert workflow.trace.succeeded().size() == 12 + 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