Skip to content

Commit

Permalink
Add a test without a job input
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-tan committed Jun 19, 2024
1 parent 0379193 commit 8f93b83
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
8 changes: 7 additions & 1 deletion tests/test-data/conformance_test_v1.2.cwltest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
tool: v1.0/cat1-testcli.cwl
id: cl_optional_bindings_provided
doc: Test command line with optional input (provided)
tags: [ command_line_tool ]
tags: [ command_line_tool ]

- tool: v1.0/null-expression2-tool.cwl
should_fail: true
id: expression_any_nodefaultany
doc: Test Any without defaults cannot be unspecified.
tags: [ inline_javascript, expression_tool ]
14 changes: 14 additions & 0 deletions tests/test-data/v1.0/null-expression2-tool.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env cwl-runner

class: ExpressionTool
requirements:
- class: InlineJavascriptRequirement
cwlVersion: v1.2

inputs:
i1: Any

outputs:
output: int

expression: "$({'output': (inputs.i1 == 'the-default' ? 1 : 2)})"
14 changes: 11 additions & 3 deletions tests/test_badgedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ def test_badgedir(tmp_path: Path) -> None:
assert obj.get("color", "") == "red"

required_md = badgedir / "required.md"
import sys

print(f"dir: `{required_md}`", file=sys.stderr)
assert required_md.exists()
with open(required_md) as file:
s = file.read()
Expand Down Expand Up @@ -116,3 +113,14 @@ def test_badgedir_with_baseuri(tmp_path: Path) -> None:
f"- [cl_optional_bindings_provided](https://example.com/specified/uri/conformance_test_v1.2.cwltest.yaml#L8) ([tool](https://example.com/specified/uri/v1.0/cat1-testcli.cwl), [job](https://example.com/specified/uri/v1.0/cat-n-job.json)){n}" # NOQA
f"## List of unsupported tests{n}"
) == file.read()

js_md = badgedir / "inline_javascript.md"
assert js_md.exists()
with open(js_md) as file:
assert (
f"# `inline_javascript` tests{n}"
f"## List of passed tests{n}"
f"- [expression_any_nodefaultany](https://example.com/specified/uri/conformance_test_v1.2.cwltest.yaml#L16) ([tool](https://example.com/specified/uri/v1.0/null-expression2-tool.cwl)){n}" # NOQA
f"## List of failed tests{n}"
f"## List of unsupported tests{n}"
) == file.read()
2 changes: 1 addition & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_no_label(pytester: "Pytester") -> None:
result = pytester.runpytest(
"-k", "conformance_test_v1.2.cwltest.yaml", "--cwl-tags", "required"
)
result.assert_outcomes(passed=1, skipped=1)
result.assert_outcomes(passed=1, skipped=2)


def test_cwltool_hook(pytester: "Pytester") -> None:
Expand Down

0 comments on commit 8f93b83

Please sign in to comment.