4 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f07dffaff00c/ Changeset: f07dffaff00c User: jmchilton Date: 2014-12-13 17:58:34+00:00 Summary: Docfixes for histories API. Affected #: 1 file diff -r 3adbabe74812fbc407d78aca7c3a628b5fcc9121 -r f07dffaff00c75f2e90cc992026e973a6ee171ec lib/galaxy/webapps/galaxy/api/histories.py --- a/lib/galaxy/webapps/galaxy/api/histories.py +++ b/lib/galaxy/webapps/galaxy/api/histories.py @@ -268,7 +268,7 @@ updates the values for the history with the given ``id`` :type id: str - :param id: the encoded id of the history to undelete + :param id: the encoded id of the history to update :type payload: dict :param payload: a dictionary containing any or all the fields in :func:`galaxy.model.History.to_dict` and/or the following: @@ -300,7 +300,7 @@ history. :type id: str - :param id: the encoded id of the history to undelete + :param id: the encoded id of the history to export :rtype: dict :returns: object containing url to fetch export from. https://bitbucket.org/galaxy/galaxy-central/commits/b234bb03a26b/ Changeset: b234bb03a26b User: jmchilton Date: 2014-12-13 17:58:34+00:00 Summary: Test for importing workflows with annotations. Affected #: 2 files diff -r f07dffaff00c75f2e90cc992026e973a6ee171ec -r b234bb03a26b6b4a9f9465cad307765c310f12d5 test/api/test_workflow_1.ga --- a/test/api/test_workflow_1.ga +++ b/test/api/test_workflow_1.ga @@ -1,6 +1,6 @@ { "a_galaxy_workflow": "true", - "annotation": "", + "annotation": "simple workflow", "format-version": "0.1", "name": "TestWorkflow1", "steps": { diff -r f07dffaff00c75f2e90cc992026e973a6ee171ec -r b234bb03a26b6b4a9f9465cad307765c310f12d5 test/api/test_workflows.py --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -238,6 +238,21 @@ self._assert_status_code_is( other_import_response, 200 ) self._assert_user_has_workflow_with_name( "imported: test_import_published_deprecated (imported from API)") + def test_import_annotations( self ): + workflow_id = self.workflow_populator.simple_workflow( "test_import_annotations", publish=True ) + with self._different_user(): + other_import_response = self.__import_workflow( workflow_id ) + self._assert_status_code_is( other_import_response, 200 ) + + # Test annotations preserved during upload and copied over during + # import. + other_id = other_import_response.json()["id"] + download_response = self._get( "workflows/%s" % other_id ) + imported_workflow = download_response.json() + assert imported_workflow["annotation"] == "simple workflow", download_response.json() + step_annotations = set(map(lambda step: step["annotation"], imported_workflow["steps"].values())) + assert "input1 description" in step_annotations + def test_not_importable_prevents_import( self ): workflow_id = self.workflow_populator.simple_workflow( "test_not_importportable" ) with self._different_user(): https://bitbucket.org/galaxy/galaxy-central/commits/5ec798bc9e18/ Changeset: 5ec798bc9e18 User: jmchilton Date: 2014-12-13 17:58:34+00:00 Summary: Fix for YAML workflow DSL respect multiple input connections. With test case for this. Affected #: 2 files diff -r b234bb03a26b6b4a9f9465cad307765c310f12d5 -r 5ec798bc9e184d05ac70a501f28acdd14aeb7193 test/api/test_workflows_from_yaml.py --- a/test/api/test_workflows_from_yaml.py +++ b/test/api/test_workflows_from_yaml.py @@ -30,6 +30,26 @@ """) self._get("workflows/%s/download" % workflow_id).content + def test_multiple_input( self ): + history_id = self.dataset_populator.new_history() + self._run_jobs(""" +steps: + - type: input + label: input1 + - type: input + label: input2 + - tool_id: cat_list + state: + input1: + - $link: input1 + - $link: input2 +test_data: + input1: "hello world" + input2: "123" +""", history_id=history_id) + contents1 = self.dataset_populator.get_history_dataset_content(history_id) + assert contents1 == "hello world\n123\n" + def test_simple_output_actions( self ): history_id = self.dataset_populator.new_history() self._run_jobs(""" diff -r b234bb03a26b6b4a9f9465cad307765c310f12d5 -r 5ec798bc9e184d05ac70a501f28acdd14aeb7193 test/api/yaml_to_workflow.py --- a/test/api/yaml_to_workflow.py +++ b/test/api/yaml_to_workflow.py @@ -111,7 +111,6 @@ "annotation": "", "post_job_actions": {}, } ) - __ensure_inputs_connections(step) post_job_actions = step["post_job_actions"] tool_state = { @@ -163,22 +162,8 @@ tool_state[key] = json.dumps(value) del step["state"] - for key, values in connect.iteritems(): - input_connection_value = [] - if not isinstance(values, list): - values = [ values ] - for value in values: - if not isinstance(value, dict): - value_parts = str(value).split("#") - if len(value_parts) == 1: - value_parts.append("output") - id = value_parts[0] - if id in context.labels: - id = context.labels[id] - value = {"id": int(id), "output_name": value_parts[1]} - input_connection_value.append(value) - # TODO: this should be a list - step["input_connections"][key] = input_connection_value[0] + # Fill in input connections + __populate_input_connections(context, step, connect) __populate_tool_state(step, tool_state) @@ -233,6 +218,27 @@ return new_key +def __populate_input_connections(context, step, connect): + __ensure_inputs_connections(step) + input_connections = step["input_connections"] + + for key, values in connect.iteritems(): + input_connection_value = [] + if not isinstance(values, list): + values = [ values ] + for value in values: + if not isinstance(value, dict): + value_parts = str(value).split("#") + if len(value_parts) == 1: + value_parts.append("output") + id = value_parts[0] + if id in context.labels: + id = context.labels[id] + value = {"id": int(id), "output_name": value_parts[1]} + input_connection_value.append(value) + input_connections[key] = input_connection_value + + def __ensure_inputs_connections(step): if "input_connections" not in step: step["input_connections"] = {} https://bitbucket.org/galaxy/galaxy-central/commits/e2a806ffe023/ Changeset: e2a806ffe023 User: jmchilton Date: 2014-12-13 17:58:34+00:00 Summary: Extend workflow YAML syntax to work with pause steps. Affected #: 2 files diff -r 5ec798bc9e184d05ac70a501f28acdd14aeb7193 -r e2a806ffe023a33b43013323cc537967f1346ff3 test/api/test_workflows_from_yaml.py --- a/test/api/test_workflows_from_yaml.py +++ b/test/api/test_workflows_from_yaml.py @@ -78,4 +78,27 @@ assert details1["name"] == "the new value", details1 details2 = self.dataset_populator.get_history_dataset_details(history_id, hid=3) assert details2["visible"] + + def test_pause( self ): + workflow_id = self._upload_yaml_workflow(""" +- label: test_input + type: input +- label: first_cat + tool_id: cat1 + state: + input1: + $link: test_input +- label: the_pause + type: pause + connect: + input: + - first_cat#out_file1 +- label: second_cat + tool_id: cat1 + state: + input1: + $link: the_pause +""") + print self._get("workflows/%s/download" % workflow_id).json() assert False + # TODO: fill out test... diff -r 5ec798bc9e184d05ac70a501f28acdd14aeb7193 -r e2a806ffe023a33b43013323cc537967f1346ff3 test/api/yaml_to_workflow.py --- a/test/api/yaml_to_workflow.py +++ b/test/api/yaml_to_workflow.py @@ -103,6 +103,35 @@ __populate_tool_state(step, tool_state) +def transform_pause(context, step, default_name="Pause for dataset review"): + default_name = step.get("label", default_name) + __ensure_defaults( step, { + "annotation": "", + }) + + __ensure_inputs_connections(step) + + if not "inputs" in step: + step["inputs"] = [{}] + + step_inputs = step["inputs"][0] + if "name" in step_inputs: + name = step_inputs["name"] + else: + name = default_name + + __ensure_defaults( step_inputs, { + "name": name, + }) + tool_state = { + "name": name + } + + connect = __init_connect_dict(step) + __populate_input_connections(context, step, connect) + __populate_tool_state(step, tool_state) + + def transform_tool(context, step): if "tool_id" not in step: raise Exception("Tool steps must define a tool_id.") @@ -118,11 +147,7 @@ "__page__": 0, } - if "connect" not in step: - step["connect"] = {} - - connect = step["connect"] - del step["connect"] + connect = __init_connect_dict(step) def append_link(key, value): if key not in connect: @@ -218,6 +243,15 @@ return new_key +def __init_connect_dict(step): + if "connect" not in step: + step["connect"] = {} + + connect = step["connect"] + del step["connect"] + return connect + + def __populate_input_connections(context, step, connect): __ensure_inputs_connections(step) input_connections = step["input_connections"] Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.