Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArraySchema.items does need typeDSL after all #1515

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,5 @@ $graph:
_id: "sld:items"
_type: "@vocab"
refScope: 2
typeDSL: true
doc: "Defines the type of the array elements."
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,5 @@ $graph:
_id: "sld:items"
_type: "@vocab"
refScope: 2
typeDSL: true
doc: "Defines the type of the array elements."
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,5 @@ $graph:
_id: "sld:items"
_type: "@vocab"
refScope: 2
typeDSL: true
doc: "Defines the type of the array elements."
13 changes: 12 additions & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,17 @@ def test_custom_type_in_step_process() -> None:
assert err_code == 0


@pytest.mark.parametrize("version", ["1_0", "1_1", "1_2"])
def test_array_items_typedsl(version: str) -> None:
"""Demonstrate that 'type: array, items: SomeType[]' works."""
err_code, _, stderr = get_main_output(
[
get_data(f"tests/wf/nested_typedsl_v{version}.cwl"),
get_data("tests/wf/nested_typedsl_job.yml"),
]
)
assert err_code == 0

def test_expression_tool_class() -> None:
"""Confirm properties of the ExpressionTool class."""
factory = cwltool.factory.Factory()
Expand All @@ -1617,4 +1628,4 @@ def test_command_line_tool_class() -> None:
factory = cwltool.factory.Factory()
tool_path = get_data("tests/echo.cwl")
expression_tool = factory.make(tool_path).t
assert str(expression_tool) == f"CommandLineTool: file://{tool_path}"
assert str(expression_tool) == f"CommandLineTool: file://{tool_path}"
5 changes: 5 additions & 0 deletions tests/wf/nested_typedsl_job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cat_in:
- - class: File
location: echo.cwl
- class: File
location: cat.cwl
14 changes: 14 additions & 0 deletions tests/wf/nested_typedsl_v1_0.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
baseCommand: cat
inputs:
cat_in:
type:
type: array
items: File[]
inputBinding: {}
stdout: all.txt
outputs:
txt:
type: stdout
14 changes: 14 additions & 0 deletions tests/wf/nested_typedsl_v1_1.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
baseCommand: cat
inputs:
cat_in:
type:
type: array
items: File[]
inputBinding: {}
stdout: all.txt
outputs:
txt:
type: stdout
14 changes: 14 additions & 0 deletions tests/wf/nested_typedsl_v1_2.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
baseCommand: cat
inputs:
cat_in:
type:
type: array
items: File[]
inputBinding: {}
stdout: all.txt
outputs:
txt:
type: stdout