Skip to content

Commit f0f9bc2

Browse files
tetronmr-c
andauthored
test case for hash marks in file names (#159)
* add --relax-path-checks to cwltool * finish label→id migration Co-authored-by: Michael R. Crusoe <[email protected]>
1 parent 9b091ed commit f0f9bc2

File tree

6 files changed

+50
-41
lines changed

6 files changed

+50
-41
lines changed

.github/workflows/cwltool.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
run: pip install cwltest cwltool
2727

2828
- name: Run tests against the reference runner
29-
run: ./run_test.sh RUNNER=cwltool EXTRA=--parallel -j$(nproc)
29+
run: ./run_test.sh RUNNER=cwltool "EXTRA=--parallel --relax-path-checks" -j$(nproc)

CONFORMANCE_TESTS.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,16 @@ Can be mixed with the other test selectors: `-n5-7,15 -N6` == only runs the 5th,
5757

5858
`-s{test_names}`
5959

60-
Run the specific tests according to their `label`s. `{test_names}` is a comma separated list of
61-
test labels. `-scl_optional_bindings_provided,stdout_redirect_docker,expression_any_null`
60+
Run the specific tests according to their `id`s. `{test_names}` is a comma separated list of
61+
test identifiers (the `id` field). `-scl_optional_bindings_provided,stdout_redirect_docker,expression_any_null`
6262
achieves the same effect as `-n5-7,15 -N6` and it will still work if the tests are re-ordered.
6363

6464
`-S{test_names}`
6565

66-
Excludes specific tests according to their `label`s. `{test_names}` is a comma separated list of
67-
test labels. `--tags shell_command -Sstderr_redirect_shortcut` will run all test with `expression_tool`
68-
in their `tags` list except the test with the label `stderr_redirect_shortcut`.
66+
Excludes specific tests according to their `id`s. `{test_names}` is a comma separated list of
67+
test identifiers (the `id` field). `--tags shell_command -Sstderr_redirect_shortcut`
68+
will run all tests with `expression_tool` in their `tags` list except the test
69+
with the `id` of `stderr_redirect_shortcut`.
6970

7071
### Misc
7172

@@ -125,7 +126,7 @@ The conformance test file is a YAML document: a list of key-value pairs.
125126
We will use this single entry to explain the format
126127
``` yaml
127128
- doc: Test command line with optional input (missing)
128-
label: cl_optional_inputs_missing
129+
id: cl_optional_inputs_missing
129130
tool: tests/cat1-testcli.cwl
130131
job: tests/cat-job.json
131132
output:
@@ -135,7 +136,7 @@ We will use this single entry to explain the format
135136
- `doc`: A unique, single-line sentence that explain what is being tested.
136137
Will be printed at test execution time, so please don't make it too long!
137138
Additional documentation can go as comments in the CWL document itself.
138-
- `label`: a short list of underscore (`_`) separated words that succinctly identifies and explains the test.
139+
- `id`: a short list of underscore (`_`) separated words that succinctly identifies and explains the test.
139140
- `tool` the path to the CWL document to run
140141
- `job`: the CWL input object in YAML/JSON format. If there are no inputs then use `tests/empty.json`.
141142
- `output` [the CWL output object expected.](#output-matching)
@@ -155,10 +156,6 @@ Example: [`- $import: tests/string-interpolation/test-index.yaml`](https://githu
155156
adds all the entries in [`tests/string-interpolation/test-index.yaml`](https://github.com/common-workflow-language/cwl-v1.2/blob/main/tests/string-interpolation/test-index.yaml)
156157
as entries in the main conformance test file.
157158

158-
You may also see references to an `id` field. Don't add them for new tests,
159-
[we are migrating off of the `id` field](common-workflow-language/cwltest#110) to
160-
rely only on the `label`s.
161-
162159
## Output matching
163160

164161
In each test entry there is an `output` field that contains a mapping of the expected outputs names and their values.

conformance_tests.yaml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# every "id" must be unique
2-
# every "label" must be unique and have no spaces
1+
# every "id" must be unique and have no spaces
32
# every "doc" must be unique
4-
# "label" and "doc" should be meaningful
3+
# "id" and "doc" should be meaningful
54

65
- job: tests/bwa-mem-job.json
76
tool: tests/bwa-mem-tool.cwl
@@ -3320,11 +3319,11 @@
33203319
job: tests/record-order-job.json
33213320
output:
33223321
args: [-a, -b, '1', -c, '3', -d, -e, '2', -f, '4']
3323-
label: record-order-with-input-bindings
3322+
id: record_order_with_input_bindings
33243323
doc: Test sorting arguments at each level (inputBinding for all levels)
33253324
tags: [ command_line, required ]
33263325

3327-
- label: output_reference_workflow_input
3326+
- id: output_reference_workflow_input
33283327
output: {
33293328
"last": "me"
33303329
}
@@ -3333,7 +3332,7 @@
33333332
Direct use of Workflow level input fields in the outputs.
33343333
tags: [ required, workflow ]
33353334

3336-
- label: stdout_chained_commands
3335+
- id: stdout_chained_commands
33373336
output: {
33383337
"out": "a\nb\n"
33393338
}
@@ -3345,7 +3344,7 @@
33453344
and capture the output correctly.
33463345
tags: [ shell_command, command_line_tool ]
33473346

3348-
- label: multiple-input-feature-requirement
3347+
- id: multiple-input-feature-requirement
33493348
output: {
33503349
"hello_world_in_two_lines": [
33513350
"hello\n",
@@ -3357,7 +3356,7 @@
33573356
MultipleInputFeatureRequirement on workflow outputs.
33583357
tags: [ workflow, multiple_input ]
33593358

3360-
- label: js-input-record
3359+
- id: js-input-record
33613360
# The output does not have the last \n due to the -n passed to echo
33623361
output: {
33633362
"out": "JS\nwith\nrecord"
@@ -3373,8 +3372,23 @@
33733372
output: {
33743373
"out": "1970-01-01T00:00:00Z\n"
33753374
}
3376-
label: schemadef_types_with_import
3375+
id: schemadef_types_with_import
33773376
doc: >-
33783377
Test SchemaDefRequirement with a workflow, with the `$import` under types.
33793378
It is similar to schemadef-wf, but the `$import` is different.
33803379
tags: [ workflow, schema_def ]
3380+
3381+
- id: filename_with_hash_mark
3382+
tool: tests/cat-tool.cwl
3383+
job: tests/octo.yml
3384+
doc: Test for correct handling of URL-quoting in filename to refer to filename containing a hash mark
3385+
output: {
3386+
"output": {
3387+
"basename": "output",
3388+
"checksum": "sha1$06b0c59808c236447d065db8f7d2a60de0a805bf",
3389+
"class": "File",
3390+
"location": "output",
3391+
"size": 8
3392+
}
3393+
}
3394+
tags: [ required, command_line_tool ]

tests/octo.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (C) The Arvados Authors. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
file1:
6+
class: File
7+
location: "octothorpe/item %231.txt"

tests/octothorpe/item #1.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
item #1

tests/scatter/test-index.yaml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
- job: scatter-job.yml
2-
id: scatter-1
3-
label: simple-simple-scatter
2+
id: simple_simple_scatter
43
tool: simple-simple-scatter.cwl
54
output:
65
"result": [
@@ -13,8 +12,7 @@
1312
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
1413

1514
- job: scatter2-job.yml
16-
id: scatter-2
17-
label: dotproduct-simple-scatter
15+
id: dotproduct_simple_scatter
1816
tool: dotproduct-simple-scatter.cwl
1917
output:
2018
"result": [
@@ -27,8 +25,7 @@
2725
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
2826

2927
- job: scatter3-job.yml
30-
id: scatter-3
31-
label: simple-dotproduct-scatter
28+
id: simple_dotproduct_scatter
3229
tool: simple-dotproduct-scatter.cwl
3330
output:
3431
"result": [
@@ -41,8 +38,7 @@
4138
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
4239

4340
- job: scatter4-job.yml
44-
id: scatter-4
45-
label: dotproduct-dotproduct-scatter
41+
id: dotproduct_dotproduct_scatter
4642
tool: dotproduct-dotproduct-scatter.cwl
4743
output:
4844
"result": [
@@ -55,8 +51,7 @@
5551
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
5652

5753
- job: scatter2-job.yml
58-
id: scatter-5
59-
label: flat-crossproduct-simple-scatter
54+
id: flat_crossproduct_simple_scatter
6055
tool: flat-crossproduct-simple-scatter.cwl
6156
output:
6257
"result": [
@@ -81,8 +76,7 @@
8176
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
8277

8378
- job: scatter3-job.yml
84-
id: scatter-6
85-
label: simple-flat-crossproduct-scatter
79+
id: simple_flat_crossproduct_scatter
8680
tool: simple-flat-crossproduct-scatter.cwl
8781
output:
8882
"result": [
@@ -95,8 +89,7 @@
9589
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
9690

9791
- job: scatter4-job.yml
98-
id: scatter-7
99-
label: flat-crossproduct-flat-crossproduct-scatter
92+
id: flat_crossproduct_flat_crossproduct_scatter
10093
tool: flat-crossproduct-flat-crossproduct-scatter.cwl
10194
output:
10295
"result": [
@@ -121,8 +114,7 @@
121114
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
122115

123116
- job: scatter2-job.yml
124-
id: scatter-8
125-
label: nested-crossproduct-simple-scatter
117+
id: nested_crossproduct_simple_scatter
126118
tool: nested-crossproduct-simple-scatter.cwl
127119
output:
128120
"result": [
@@ -155,8 +147,7 @@
155147
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
156148

157149
- job: scatter3-job.yml
158-
id: scatter-9
159-
label: simple-nested-crossproduct-scatter
150+
id: simple_nested_crossproduct_scatter
160151
tool: simple-nested-crossproduct-scatter.cwl
161152
output:
162153
"result": [
@@ -189,8 +180,7 @@
189180
tags: [ workflow, subworkflow, scatter, inline_javascript, expression_tool ]
190181

191182
- job: scatter4-job.yml
192-
id: scatter-10
193-
label: nested-crossproduct-nested-crossproduct-scatter
183+
id: nested_crossproduct_nested_crossproduct_scatter
194184
tool: nested-crossproduct-nested-crossproduct-scatter.cwl
195185
output:
196186
"result": [

0 commit comments

Comments
 (0)