Skip to content

Commit

Permalink
Add test for workflow update from mixed tool sheds
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Apr 10, 2024
1 parent e70b1a7 commit 2c121c0
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"steps": {
"0": {
"collection_type": "paired",
"type": "data_collection_input",
"label": "pe-fastq",
"id": 0,
"position": {
"left": 0,
"top": 0
},
"annotation": "",
"input_connections": {},
"inputs": [
{
"name": "pe-fastq",
"description": ""
}
],
"tool_state": "{\"name\": \"pe-fastq\", \"collection_type\": \"paired\"}"
},
"1": {
"label": "fastqc 1",
"tool_id": "toolshed.g2.bx.psu.edu/repos/bgruening/text_processing/tp_find_and_replace/9.3+galaxy0",
"tool_version": "9.3+galaxy0",
"tool_shed_repository": {
"name": "text_processing",
"owner": "bgruening",
"tool_shed": "toolshed.g2.bx.psu.edu",
"changeset_revision": "12615d397df7"
},
"id": 1,
"position": {
"left": 10,
"top": 10
},
"type": "tool",
"name": "toolshed.g2.bx.psu.edu/repos/bgruening/text_processing/tp_find_and_replace/9.3+galaxy0",
"post_job_actions": {},
"annotation": "",
"input_connections": {
"input_file": [
{
"id": 0,
"output_name": "output"
}
]
},
"tool_state": "{\"__page__\": 0}",
"workflow_outputs": [
{
"output_name": "text_file",
"label": "FastQC txt",
"uuid": null
}
]
},
"2": {
"label": "fastqc 2",
"tool_id": "testtoolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.69",
"tool_version": "0.69",
"tool_shed_repository": {
"name": "fastqc",
"owner": "devteam",
"tool_shed": "testtoolshed.g2.bx.psu.edu",
"changeset_revision": "7b0207bd2183"
},
"id": 2,
"position": {
"left": 20,
"top": 20
},
"type": "tool",
"name": "testtoolshed.g2.bx.psu.edu/repos/devteam/fastqc/fastqc/0.69",
"post_job_actions": {},
"annotation": "",
"input_connections": {
"input_file": [
{
"id": 0,
"output_name": "output"
}
]
},
"tool_state": "{\"__page__\": 0}"
}
},
"a_galaxy_workflow": "true",
"format-version": "0.1",
"name": "Workflow",
"uuid": "869b6bb3-23a8-4322-a325-cc55abdf7540",
"annotation": "Run fastqc"
}
13 changes: 13 additions & 0 deletions tests/test_cmd_autoupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ def test_autoupdate_workflow(self):
assert wf["steps"][1]["run"]["steps"][0]["tool_version"] == "3.7+galaxy0"
assert wf["release"] == "0.1.1"

def test_autoupdate_workflow_from_multiple_tool_sheds(self):
with self._isolate_with_test_data("wf_repos/autoupdate_tests") as f:
wf_file = os.path.realpath(os.path.join(f, "wf_autoupdate_test_multiple_repos.ga"))
autoupdate_command = ["autoupdate", wf_file]
result = self._runner.invoke(self._cli.planemo, autoupdate_command)
assert f"Auto-updating workflow {wf_file}" in result.output
with open(wf_file) as g:
wf = json.load(g)
# Assert toolshed tool is updated
assert wf["steps"]["1"]["tool_version"] != "9.3+galaxy0"
# Assert testtoolshed tool is updated
assert wf["steps"]["2"]["tool_version"] != "0.69"

def test_autoupdate_workflow_unexisting_version(self):
"""Test autoupdate command for a workflow where the version of the tool is not in the toolshed."""
with self._isolate_with_test_data("wf_repos/autoupdate_tests") as f:
Expand Down

0 comments on commit 2c121c0

Please sign in to comment.