Skip to content

Commit

Permalink
More, better workflow editor Selenium tests - part 2.
Browse files Browse the repository at this point in the history
- More stuff tested:
  - Connecting and disconnecting nodes.
  - Rendering simple wfs with output collections and subworkflows.
- More screenshots.
  • Loading branch information
jmchilton committed Apr 12, 2018
1 parent e015926 commit 74bd46f
Show file tree
Hide file tree
Showing 8 changed files with 285 additions and 168 deletions.
8 changes: 4 additions & 4 deletions templates/base/base_panels.mako
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
<div id="left">
${self.left_panel()}
<div class="unified-panel-footer">
<div class="panel-collapse"></div>
<div class="drag"></div>
<div id="left-panel-collapse" class="panel-collapse"></div>
<div id="left-panel-drag" class="drag"></div>
</div>
</div><!--end left-->
%endif
Expand All @@ -235,8 +235,8 @@
<div id="right">
${self.right_panel()}
<div class="unified-panel-footer">
<div class="panel-collapse right"></div>
<div class="drag"></div>
<div id="right-panel-collapse" class="panel-collapse right"></div>
<div id="right-panel-drag" class="drag"></div>
</div>
</div><!--end right-->
%endif
Expand Down
8 changes: 4 additions & 4 deletions templates/webapps/galaxy/galaxy.panels.mako
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@
</div>
<div class="unified-panel-body" style="overflow: auto;"></div>
<div class="unified-panel-footer">
<div class="panel-collapse right"></span></div>
<div class="drag"></div>
<div id="left-panel-collapse" class="panel-collapse right"></span></div>
<div id="left-panel-drag" class="drag"></div>
</div>
</div>
%endif
Expand All @@ -237,8 +237,8 @@
</div>
<div class="unified-panel-body" style="overflow: auto;"></div>
<div class="unified-panel-footer">
<div class="panel-collapse right"></span></div>
<div class="drag"></div>
<div id="right-panel-collapse" class="panel-collapse right"></span></div>
<div id="right-panel-drag" class="drag"></div>
</div>
</div>
%endif
Expand Down
131 changes: 13 additions & 118 deletions test/api/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,16 @@
wait_on,
WorkflowPopulator
)
from base.workflow_fixtures import ( # noqa: I100
WORKFLOW_NESTED_SIMPLE,
WORKFLOW_WITH_OUTPUT_COLLECTION,
WORKFLOW_WITH_OUTPUT_COLLECTION_MAPPING,
WORKFLOW_WITH_RULES_1,
)
from galaxy.exceptions import error_codes # noqa: I201
from galaxy.tools.verify.test_data import TestDataResolver


SIMPLE_NESTED_WORKFLOW_YAML = """
class: GalaxyWorkflow
inputs:
- id: outer_input
outputs:
- id: outer_output
source: second_cat#out_file1
steps:
- tool_id: cat1
label: first_cat
state:
input1:
$link: outer_input
- run:
class: GalaxyWorkflow
inputs:
- id: inner_input
outputs:
- id: workflow_output
source: random_lines#out_file1
steps:
- tool_id: random_lines1
label: random_lines
state:
num_lines: 1
input:
$link: inner_input
seed_source:
seed_source_selector: set_seed
seed: asdf
label: nested_workflow
connect:
inner_input: first_cat#out_file1
- tool_id: cat1
label: second_cat
state:
input1:
$link: nested_workflow#workflow_output
queries:
- input2:
$link: nested_workflow#workflow_output
"""


class BaseWorkflowsApiTestCase(api.ApiTestCase):
# TODO: Find a new file for this class.

Expand Down Expand Up @@ -418,7 +380,7 @@ def get_subworkflow_content_id(workflow_id):
subworkflow_step = next(s for s in steps.values() if s["type"] == "subworkflow")
return subworkflow_step['content_id']

workflow_id = self._upload_yaml_workflow(SIMPLE_NESTED_WORKFLOW_YAML, publish=True)
workflow_id = self._upload_yaml_workflow(WORKFLOW_NESTED_SIMPLE, publish=True)
subworkflow_content_id = get_subworkflow_content_id(workflow_id)
with self._different_user():
other_import_response = self.__import_workflow(workflow_id)
Expand Down Expand Up @@ -577,21 +539,7 @@ def __run_cat_workflow(self, inputs_by):

@skip_without_tool("collection_creates_pair")
def test_workflow_run_output_collections(self):
workflow_id = self._upload_yaml_workflow("""
class: GalaxyWorkflow
steps:
- label: text_input
type: input
- label: split_up
tool_id: collection_creates_pair
state:
input1:
$link: text_input
- tool_id: collection_paired_test
state:
f1:
$link: split_up#paired_output
""")
workflow_id = self._upload_yaml_workflow(WORKFLOW_WITH_OUTPUT_COLLECTION)
with self.dataset_populator.test_history() as history_id:
hda1 = self.dataset_populator.new_dataset(history_id, content="a\nb\nc\nd\n")
inputs = {
Expand Down Expand Up @@ -723,23 +671,7 @@ def test_workflow_resume_with_mapped_over_input(self):

@skip_without_tool("collection_creates_pair")
def test_workflow_run_output_collection_mapping(self):
workflow_id = self._upload_yaml_workflow("""
class: GalaxyWorkflow
steps:
- type: input_collection
- tool_id: collection_creates_pair
state:
input1:
$link: 0
- tool_id: collection_paired_test
state:
f1:
$link: 1#paired_output
- tool_id: cat_list
state:
input1:
$link: 2#out1
""")
workflow_id = self._upload_yaml_workflow(WORKFLOW_WITH_OUTPUT_COLLECTION_MAPPING)
with self.dataset_populator.test_history() as history_id:
hdca1 = self.dataset_collection_populator.create_list_in_history(history_id, contents=["a\nb\nc\nd\n", "e\nf\ng\nh\n"]).json()
self.dataset_populator.wait_for_history(history_id, assert_ok=True)
Expand Down Expand Up @@ -934,7 +866,7 @@ def test_run_subworkflow_simple(self):
outer_input:
value: 1.bed
type: File
""" % SIMPLE_NESTED_WORKFLOW_YAML
""" % WORKFLOW_NESTED_SIMPLE
self._run_jobs(workflow_run_description, history_id=history_id)

content = self.dataset_populator.get_history_dataset_content(history_id)
Expand Down Expand Up @@ -984,44 +916,7 @@ def test_workflow_run_zip_collections(self):
@skip_without_tool("__APPLY_RULES__")
def test_workflow_run_apply_rules(self):
with self.dataset_populator.test_history() as history_id:
self._run_jobs("""
class: GalaxyWorkflow
inputs:
- type: collection
label: input_c
steps:
- label: apply
tool_id: __APPLY_RULES__
state:
input:
$link: input_c
rules:
rules:
- type: add_column_metadata
value: identifier0
- type: add_column_metadata
value: identifier0
mapping:
- type: list_identifiers
columns: [0, 1]
- tool_id: random_lines1
label: random_lines
state:
num_lines: 1
input:
$link: apply#output
seed_source:
seed_source_selector: set_seed
seed: asdf
test_data:
input_c:
type: list
elements:
- identifier: i1
content: "0"
- identifier: i2
content: "1"
""", history_id=history_id, wait=True, assert_ok=True)
self._run_jobs(WORKFLOW_WITH_RULES_1, history_id=history_id, wait=True, assert_ok=True)
output_content = self.dataset_populator.get_history_collection_details(history_id, hid=6)
rules_test_data.check_example_2(output_content, self.dataset_populator)

Expand Down Expand Up @@ -1254,7 +1149,7 @@ def test_workflow_run_input_mapping_with_subworkflows(self):
- identifier: el2
value: 1.fastq
type: File
""" % SIMPLE_NESTED_WORKFLOW_YAML, history_id=history_id)
""" % WORKFLOW_NESTED_SIMPLE, history_id=history_id)
workflow_id = summary.workflow_id
invocation_id = summary.invocation_id
invocation_response = self._get("workflows/%s/invocations/%s" % (workflow_id, invocation_id))
Expand Down Expand Up @@ -1844,7 +1739,7 @@ def test_nested_workflow_rerun_with_use_cached_job(self):
outer_input:
value: 1.bed
type: File
""" % SIMPLE_NESTED_WORKFLOW_YAML
""" % WORKFLOW_NESTED_SIMPLE
run_jobs_summary = self._run_jobs(workflow_run_description, history_id=history_id_one)
self.dataset_populator.wait_for_history(history_id_one, assert_ok=True)
workflow_request = run_jobs_summary.workflow_request
Expand Down
158 changes: 158 additions & 0 deletions test/base/workflow_fixtures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@

WORKFLOW_SIMPLE_CAT_TWICE = """
class: GalaxyWorkflow
inputs:
- id: input1
steps:
- tool_id: cat
label: first_cat
state:
input1:
$link: input1
queries:
- input2:
$link: input1
"""

WORKFLOW_WITH_OLD_TOOL_VERSION = """
class: GalaxyWorkflow
inputs:
- id: input1
steps:
- tool_id: multiple_versions
tool_version: "0.0.1"
state:
inttest: 8
"""


WORKFLOW_WITH_INVALID_STATE = """
class: GalaxyWorkflow
inputs:
- id: input1
steps:
- tool_id: multiple_versions
tool_version: "0.0.1"
state:
inttest: "moocow"
"""


WORKFLOW_WITH_OUTPUT_COLLECTION = """
class: GalaxyWorkflow
steps:
- label: text_input
type: input
- label: split_up
tool_id: collection_creates_pair
state:
input1:
$link: text_input
- tool_id: collection_paired_test
state:
f1:
$link: split_up#paired_output
"""


WORKFLOW_WITH_OUTPUT_COLLECTION_MAPPING = """
class: GalaxyWorkflow
steps:
- type: input_collection
- tool_id: collection_creates_pair
state:
input1:
$link: 0
- tool_id: collection_paired_test
state:
f1:
$link: 1#paired_output
- tool_id: cat_list
state:
input1:
$link: 2#out1
"""


WORKFLOW_WITH_RULES_1 = """
class: GalaxyWorkflow
inputs:
- type: collection
label: input_c
steps:
- label: apply
tool_id: __APPLY_RULES__
state:
input:
$link: input_c
rules:
rules:
- type: add_column_metadata
value: identifier0
- type: add_column_metadata
value: identifier0
mapping:
- type: list_identifiers
columns: [0, 1]
- tool_id: random_lines1
label: random_lines
state:
num_lines: 1
input:
$link: apply#output
seed_source:
seed_source_selector: set_seed
seed: asdf
test_data:
input_c:
type: list
elements:
- identifier: i1
content: "0"
- identifier: i2
content: "1"
"""


WORKFLOW_NESTED_SIMPLE = """
class: GalaxyWorkflow
inputs:
- id: outer_input
outputs:
- id: outer_output
source: second_cat#out_file1
steps:
- tool_id: cat1
label: first_cat
state:
input1:
$link: outer_input
- run:
class: GalaxyWorkflow
inputs:
- id: inner_input
outputs:
- id: workflow_output
source: random_lines#out_file1
steps:
- tool_id: random_lines1
label: random_lines
state:
num_lines: 1
input:
$link: inner_input
seed_source:
seed_source_selector: set_seed
seed: asdf
label: nested_workflow
connect:
inner_input: first_cat#out_file1
- tool_id: cat1
label: second_cat
state:
input1:
$link: nested_workflow#workflow_output
queries:
- input2:
$link: nested_workflow#workflow_output
"""
Loading

0 comments on commit 74bd46f

Please sign in to comment.