From 3be7e7cb8feab65d1e222a36625b7589a521541a Mon Sep 17 00:00:00 2001 From: LanderOtto Date: Wed, 18 Dec 2024 15:40:28 +0100 Subject: [PATCH] Added test on `glob` when is a list --- conformance_tests.yaml | 31 +++++++++++++++++++++++++++++++ tests/dir-job1.yml | 3 +++ tests/glob-list.cwl | 18 ++++++++++++++++++ tests/testdir1/a.txt | 1 + tests/testdir1/b.csv | 2 ++ tests/testdir1/c.txt | 1 + tests/testdir1/d | 0 7 files changed, 56 insertions(+) create mode 100644 tests/dir-job1.yml create mode 100644 tests/glob-list.cwl create mode 100644 tests/testdir1/a.txt create mode 100644 tests/testdir1/b.csv create mode 100644 tests/testdir1/c.txt create mode 100644 tests/testdir1/d diff --git a/conformance_tests.yaml b/conformance_tests.yaml index ee8c0a6c..26882f9a 100644 --- a/conformance_tests.yaml +++ b/conformance_tests.yaml @@ -3393,6 +3393,37 @@ } tags: [ required, command_line_tool ] +- id: glob_list + tool: tests/glob-list.cwl + job: tests/dir-job1.yml + doc: Test the glob can be a list + output: { + "result": [ + { + "basename": "a.txt", + "checksum": "sha1$2ef7bde608ce5404e97d5f042f95f89f1c232871", + "class": "File", + "location": Any, + "size": 12 + }, + { + "basename": "c.txt", + "checksum": "sha1$64d7a4802661604891785536e490635a8406f103", + "class": "File", + "location": Any, + "size": 36 + }, + { + "basename": "b.csv", + "checksum": "sha1$34bd0059091490789ffcd3fe421df8d4e5388b76", + "class": "File", + "location": Any, + "size": 7 + } + ] + } + tags: [ required, command_line_tool ] + - id: capture_files tool: tests/capture-files.cwl job: tests/dir-job.yml diff --git a/tests/dir-job1.yml b/tests/dir-job1.yml new file mode 100644 index 00000000..ce6a8f8d --- /dev/null +++ b/tests/dir-job1.yml @@ -0,0 +1,3 @@ +indir: + class: Directory + location: testdir1 \ No newline at end of file diff --git a/tests/glob-list.cwl b/tests/glob-list.cwl new file mode 100644 index 00000000..af51364a --- /dev/null +++ b/tests/glob-list.cwl @@ -0,0 +1,18 @@ +cwlVersion: v1.3.0-dev1 +class: CommandLineTool +baseCommand: [cp, -r] +arguments: + - position: 2 + valueFrom: $(runtime.outdir) +inputs: + indir: + type: Directory + inputBinding: + position: 1 +outputs: + result: + type: File[] + outputBinding: + glob: + - "$(inputs.indir.basename)/*.txt" + - "$(inputs.indir.basename)/*.csv" diff --git a/tests/testdir1/a.txt b/tests/testdir1/a.txt new file mode 100644 index 00000000..c57eff55 --- /dev/null +++ b/tests/testdir1/a.txt @@ -0,0 +1 @@ +Hello World! \ No newline at end of file diff --git a/tests/testdir1/b.csv b/tests/testdir1/b.csv new file mode 100644 index 00000000..10c73689 --- /dev/null +++ b/tests/testdir1/b.csv @@ -0,0 +1,2 @@ +1,2 +3,4 \ No newline at end of file diff --git a/tests/testdir1/c.txt b/tests/testdir1/c.txt new file mode 100644 index 00000000..9eb9e550 --- /dev/null +++ b/tests/testdir1/c.txt @@ -0,0 +1 @@ +Hello from Common Workflow Language! \ No newline at end of file diff --git a/tests/testdir1/d b/tests/testdir1/d new file mode 100644 index 00000000..e69de29b