Skip to content

Commit

Permalink
Fix workflow_lint for json output values
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Oct 18, 2023
1 parent 4d5b957 commit 2cb45dd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions planemo/workflow_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ def _lint_case(path: str, test_case: TestCase, lint_context: WorkflowLintContext

output_expectations = test_case.output_expectations[test_output_id]
all_assertion_definitions = []
if isinstance(output_expectations, (int, str, float, bool)):
# CWL style parameter output
continue
if "element_tests" in output_expectations:
# This is a collection
for element_id in output_expectations["element_tests"]:
Expand Down
5 changes: 5 additions & 0 deletions tests/data/json_value_out-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- doc: Test outline for Param-value-from-file-workflow
job:
int_in: 2
outputs:
int_out: 2
27 changes: 27 additions & 0 deletions tests/data/json_value_out.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class: GalaxyWorkflow
label: Param value from file workflow
inputs:
int_in:
optional: false
type: int
outputs:
int_out:
outputSource: pick/integer_param
steps:
pick:
tool_id: pick_value
tool_version: 0.1.0
tool_state:
style_cond:
__current_case__: 0
pick_style: first
type_cond:
__current_case__: 1
param_type: integer
pick_from:
- __index__: 0
value:
__class__: ConnectedValue
in:
style_cond|type_cond|pick_from_0|value:
source: int_in
5 changes: 5 additions & 0 deletions tests/test_cmd_workflow_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ def test_assertion_linting(self):
in result.output
)

def test_json_value_out(self):
workflow_path = "/".join((TEST_DATA_DIR, "json_value_out.yml"))
lint_cmd = ["workflow_lint", workflow_path, "--fail_level", "error"]
self._check_exit_code(lint_cmd, exit_code=0)

def test_tool_id_linting_wrong_version(self):
workflow_path = "/".join(
(TEST_DATA_DIR, "wf_repos", "autoupdate_tests", "workflow_with_unexisting_version_of_tool.ga")
Expand Down

0 comments on commit 2cb45dd

Please sign in to comment.