From 10dae9461d36c0e9c7fa8483de6931096a8d79c7 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 1 Oct 2018 07:36:36 -0400 Subject: [PATCH 1/6] Fixes for specifying test_data as a parameter to run_workflow. --- test/base/populators.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/base/populators.py b/test/base/populators.py index d66c473234dc..fdb30428db8c 100644 --- a/test/base/populators.py +++ b/test/base/populators.py @@ -589,12 +589,17 @@ def read_test_data(test_dict): return content workflow_id = workflow_populator.upload_yaml_workflow(has_workflow, source_type=source_type) - if jobs_descriptions is None: - assert source_type != "path" - jobs_descriptions = yaml.safe_load(has_workflow) if test_data is None: + if jobs_descriptions is None: + assert source_type != "path" + jobs_descriptions = yaml.safe_load(has_workflow) + test_data = jobs_descriptions.get("test_data", {}) + + if not isinstance(test_data, dict): + test_data = yaml.safe_load(test_data) + parameters = test_data.pop('step_parameters', {}) replacement_parameters = test_data.pop("replacement_parameters", {}) inputs, label_map, has_uploads = load_data_dict(history_id, test_data, self.dataset_populator, self.dataset_collection_populator) From 1e2080242cd01a57eb24b71841d1cfd79626ba4e Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 1 Oct 2018 08:02:08 -0400 Subject: [PATCH 2/6] Toward newer style gxformat2 definitions. --- test/api/test_workflows.py | 665 ++++++++++++--------------- test/api/test_workflows_from_yaml.py | 95 +--- test/base/workflow_fixtures.py | 122 +++-- 3 files changed, 401 insertions(+), 481 deletions(-) diff --git a/test/api/test_workflows.py b/test/api/test_workflows.py index 381b753d49f0..f280b1a2509b 100644 --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -986,17 +986,14 @@ def test_run_subworkflow_runtime_parameters(self): @skip_without_tool("cat") def test_run_subworkflow_replacment_parameters(self): with self.dataset_populator.test_history() as history_id: - workflow_run_description = """%s - -test_data: - replacement_parameters: - replaceme: moocow - outer_input: - value: 1.bed - type: File -""" % WORKFLOW_NESTED_REPLACEMENT_PARAMETER - self._run_jobs(workflow_run_description, history_id=history_id) - + test_data = """ +replacement_parameters: + replaceme: moocow +outer_input: + value: 1.bed + type: File +""" + self._run_jobs(WORKFLOW_NESTED_REPLACEMENT_PARAMETER, test_data=test_data, history_id=history_id, round_trip_format_conversion=True) details = self.dataset_populator.get_history_dataset_details(history_id) assert details["name"] == "moocow suffix" @@ -1196,13 +1193,9 @@ def test_workflow_output_dataset(self): steps: - tool_id: cat1 label: first_cat - state: - input1: - $link: input1 - -test_data: - input1: "hello world" -""", history_id=history_id) + in: + input1: input1 +""", test_data={"input1": "hello world"}, 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)) @@ -1229,17 +1222,16 @@ def test_workflow_output_dataset_collection(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 -test_data: - input1: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File + in: + input1: input1 +""", test_data=""" +input1: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File """, history_id=history_id) workflow_id = summary.workflow_id invocation_id = summary.invocation_id @@ -1270,20 +1262,19 @@ def test_workflow_input_mapping(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 -test_data: - input1: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File - - identifier: el2 - value: 1.fastq - type: File + in: + input1: input1 +""", test_data=""" +input1: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File + - identifier: el2 + value: 1.fastq + type: File """, history_id=history_id) workflow_id = summary.workflow_id invocation_id = summary.invocation_id @@ -1305,28 +1296,27 @@ def test_workflow_run_input_mapping_with_output_collections(self): with self.dataset_populator.test_history() as history_id: summary = self._run_jobs(""" class: GalaxyWorkflow +inputs: + - id: text_input outputs: - id: wf_output_1 source: split_up#paired_output steps: - - label: text_input - type: input - label: split_up tool_id: collection_creates_pair - state: - input1: - $link: text_input -test_data: - text_input: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File - - identifier: el2 - value: 1.fastq - type: File + in: + input1: text_input +""", test_data=""" +text_input: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File + - identifier: el2 + value: 1.fastq + type: File """, history_id=history_id) workflow_id = summary.workflow_id invocation_id = summary.invocation_id @@ -1346,20 +1336,19 @@ def test_workflow_run_input_mapping_with_output_collections(self): def test_workflow_run_input_mapping_with_subworkflows(self): with self.dataset_populator.test_history() as history_id: - summary = self._run_jobs("""%s - -test_data: - outer_input: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File - - identifier: el2 - value: 1.fastq - type: File -""" % WORKFLOW_NESTED_SIMPLE, history_id=history_id) + test_data = """ +outer_input: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File + - identifier: el2 + value: 1.fastq + type: File +""" + summary = self._run_jobs(WORKFLOW_NESTED_SIMPLE, test_data=test_data, 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)) @@ -1397,9 +1386,8 @@ def test_subworkflow_recover_mapping_1(self): steps: - tool_id: cat1 label: first_cat - state: - input1: - $link: outer_input + in: + input1: outer_input - run: class: GalaxyWorkflow inputs: @@ -1418,18 +1406,16 @@ def test_subworkflow_recover_mapping_1(self): seed_source_selector: set_seed seed: asdf label: nested_workflow - connect: - inner_input: first_cat#out_file1 + in: + inner_input: first_cat/out_file1 - tool_id: split label: split - state: - input1: - $link: nested_workflow#workflow_output + in: + input1: nested_workflow/workflow_output - tool_id: cat_list label: second_cat - state: - input1: - $link: split#output + in: + input1: split/output test_data: outer_input: @@ -1458,9 +1444,8 @@ def test_subworkflow_recover_mapping_2(self): steps: - tool_id: cat1 label: first_cat - state: - input1: - $link: outer_input + in: + input1: outer_input - run: class: GalaxyWorkflow inputs: @@ -1480,28 +1465,24 @@ def test_subworkflow_recover_mapping_2(self): seed: asdf - tool_id: split label: split - state: - input1: - $link: random_lines#out_file1 + in: + input1: random_lines/out_file1 - tool_id: cat1 label: inner_cat - state: - input1: - $link: split#output + in: + input1: split/output label: nested_workflow - connect: - inner_input: first_cat#out_file1 + in: + inner_input: first_cat/out_file1 - tool_id: cat_list label: second_cat - state: - input1: - $link: nested_workflow#workflow_output - -test_data: - outer_input: - value: 1.bed - type: File + in: + input1: nested_workflow/workflow_output +""", test_data=""" +outer_input: + value: 1.bed + type: File """, history_id=history_id, wait=True) self.assertEqual("chr6\t108722976\t108723115\tCCDS5067.1_cds_0_0_chr6_108722977_f\t0\t+\nchrX\t152691446\t152691471\tCCDS14735.1_cds_0_0_chrX_152691447_f\t0\t+\n", self.dataset_populator.get_history_dataset_content(history_id)) @@ -1520,9 +1501,8 @@ def test_recover_mapping_in_subworkflow(self): steps: - tool_id: cat1 label: first_cat - state: - input1: - $link: outer_input + in: + input1: outer_input - run: class: GalaxyWorkflow inputs: @@ -1542,22 +1522,19 @@ def test_recover_mapping_in_subworkflow(self): seed: asdf - tool_id: split label: split - state: - input1: - $link: random_lines#out_file1 + in: + input1: random_lines/out_file1 label: nested_workflow - connect: - inner_input: first_cat#out_file1 + in: + inner_input: first_cat/out_file1 - tool_id: cat_list label: second_cat - state: - input1: - $link: nested_workflow#workflow_output - -test_data: - outer_input: - value: 1.bed - type: File + in: + input1: nested_workflow/workflow_output +""", test_data=""" +outer_input: + value: 1.bed + type: File """, history_id=history_id, wait=True) self.assertEqual("chr6\t108722976\t108723115\tCCDS5067.1_cds_0_0_chr6_108722977_f\t0\t+\nchrX\t152691446\t152691471\tCCDS14735.1_cds_0_0_chrX_152691447_f\t0\t+\n", self.dataset_populator.get_history_dataset_content(history_id)) @@ -1576,9 +1553,8 @@ def test_empty_list_mapping(self): steps: - tool_id: empty_list label: empty_list - state: - input1: - $link: input1 + in: + input1: input1 - tool_id: random_lines1 label: random_lines state: @@ -1590,14 +1566,12 @@ def test_empty_list_mapping(self): seed: asdf - tool_id: count_list label: count_list - state: - input1: - $link: random_lines#out_file1 - -test_data: - input1: - value: 1.bed - type: File + in: + input1: random_lines/out_file1 +""", test_data=""" +input1: + value: 1.bed + type: File """, history_id=history_id, wait=True) self.assertEqual("0\n", self.dataset_populator.get_history_dataset_content(history_id)) @@ -1610,13 +1584,12 @@ def test_mapping_and_subcollection_mapping(self): - label: text_input1 type: input_collection - tool_id: collection_type_source_map_over - state: - input_collect: - $link: text_input1 -test_data: - text_input1: - type: "list:paired" - """, history_id=history_id) + in: + input_collect: text_input1 +""", test_data=""" +text_input1: + type: "list:paired" +""", history_id=history_id) hdca = self.dataset_populator.get_history_collection_details(history_id=jobs_summary.history_id, hid=1) assert hdca['collection_type'] == 'list:paired' assert len(hdca['elements'][0]['object']["elements"]) == 2 @@ -1636,9 +1609,8 @@ def test_empty_list_reduction(self): steps: - tool_id: empty_list label: empty_list - state: - input1: - $link: input1 + in: + input1: input1 - tool_id: random_lines1 label: random_lines state: @@ -1650,14 +1622,12 @@ def test_empty_list_reduction(self): seed: asdf - tool_id: count_multi_file label: count_multi_file - state: - input1: - $link: random_lines#out_file1 - -test_data: - input1: - value: 1.bed - type: File + in: + input1: random_lines/out_file1 +""", test_data=""" +input1: + value: 1.bed + type: File """, history_id=history_id, wait=True) self.assertEqual("0\n", self.dataset_populator.get_history_dataset_content(history_id)) @@ -1813,14 +1783,12 @@ def test_pause_outputs_with_deleted_inputs(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 - tool_id: cat label: second_cat - state: - input1: - $link: first_cat#out_file1 + in: + input1: first_cat/out_file1 """) DELETED = 0 PAUSED_1 = 3 @@ -1854,19 +1822,16 @@ def test_run_with_implicit_connection(self): type: input - label: first_cat tool_id: cat1 - state: - input1: - $link: test_input + in: + input1: test_input - label: the_pause type: pause - connect: - input: - - first_cat#out_file1 + in: + input: first_cat/out_file1 - label: second_cat tool_id: cat1 - state: - input1: - $link: the_pause + in: + input1: the_pause - label: third_cat tool_id: random_lines1 connect: @@ -1878,9 +1843,7 @@ def test_run_with_implicit_connection(self): seed_source: seed_source_selector: set_seed seed: asdf -test_data: - test_input: "hello world" -""", history_id=history_id, wait=False) +""", test_data={"test_input": "hello world"}, history_id=history_id, wait=False) history_id = run_summary.history_id workflow_id = run_summary.workflow_id invocation_id = run_summary.invocation_id @@ -1910,10 +1873,10 @@ def test_run_with_validated_parameter_connection_valid(self): r2: - text: $link: text_input -test_data: - text_input: - value: "abd" - type: raw +""", test_data=""" +text_input: + value: "abd" + type: raw """, history_id=history_id, wait=True) time.sleep(10) self.workflow_populator.wait_for_invocation(run_summary.workflow_id, run_summary.invocation_id) @@ -1933,10 +1896,10 @@ def test_run_with_validated_parameter_connection_invalid(self): r2: - text: $link: text_input -test_data: - text_input: - value: "" - type: raw +""", test_data=""" +text_input: + value: "" + type: raw """, history_id=history_id, wait=True, assert_ok=False) def test_run_with_text_connection(self): @@ -1959,13 +1922,13 @@ def test_run_with_text_connection(self): seed_source_selector: set_seed seed: $link: text_input -test_data: - data_input: - value: 1.bed - type: File - text_input: - value: asdf - type: raw +""", test_data=""" +data_input: + value: 1.bed + type: File +text_input: + value: asdf + type: raw """, history_id=history_id) self.dataset_populator.wait_for_history(history_id, assert_ok=True) @@ -1999,14 +1962,12 @@ def test_workflow_rerun_with_use_cached_job(self): @skip_without_tool('cat1') def test_nested_workflow_rerun_with_use_cached_job(self): with self.dataset_populator.test_history() as history_id_one, self.dataset_populator.test_history() as history_id_two: - workflow_run_description = """%s - -test_data: - outer_input: - value: 1.bed - type: File -""" % WORKFLOW_NESTED_SIMPLE - run_jobs_summary = self._run_jobs(workflow_run_description, history_id=history_id_one) + test_data = """ +outer_input: + value: 1.bed + type: File +""" + run_jobs_summary = self._run_jobs(WORKFLOW_NESTED_SIMPLE, test_data=test_data, history_id=history_id_one) workflow_request = run_jobs_summary.workflow_request # We copy the inputs to a new history and re-run the workflow inputs = json.loads(workflow_request['inputs']) @@ -2139,8 +2100,7 @@ def test_optional_workflow_output(self): state: produce_out_1: False filter_text_1: '1' -test_data: {} - """, history_id=history_id, wait=False) +""", test_data={}, history_id=history_id, wait=False) self.wait_for_invocation_and_jobs(history_id, run_object.workflow_id, run_object.invocation_id) contents = self.__history_contents(history_id) assert len(contents) == 1 @@ -2159,20 +2119,19 @@ def test_run_rename_on_mapped_over_collection(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 outputs: out_file1: rename: "my new name" -test_data: - input1: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File +""", test_data=""" +input1: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File """, history_id=history_id) content = self.dataset_populator.get_history_dataset_details(history_id, hid=4, wait=True, assert_ok=True) name = content["name"] @@ -2195,20 +2154,19 @@ def test_run_rename_based_on_inputs_on_mapped_over_collection(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 outputs: out_file1: rename: "#{input1} suffix" -test_data: - input1: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File +""", test_data=""" +input1: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File """, history_id=history_id) content = self.dataset_populator.get_history_collection_details(history_id, hid=3, wait=True, assert_ok=True) name = content["name"] @@ -2224,17 +2182,16 @@ def test_run_rename_collection_output(self): - id: input1 steps: - tool_id: collection_creates_pair - state: - input1: - $link: input1 + in: + input1: input1 outputs: paired_output: rename: "my new name" -test_data: - input1: - value: 1.fasta - type: File - name: fasta1 +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fasta1 """, history_id=history_id) details1 = self.dataset_populator.get_history_collection_details(history_id, hid=4, wait=True, assert_ok=True) @@ -2256,8 +2213,7 @@ def test_run_rename_multiple_outputs(self): rename: "my new name" out_file2: rename: "my other new name" -test_data: {} -""", history_id=history_id) +""", test_data={}, history_id=history_id) details1 = self.dataset_populator.get_history_dataset_details(history_id, hid=1, wait=True, assert_ok=True) details2 = self.dataset_populator.get_history_dataset_details(history_id, hid=2) @@ -2291,17 +2247,16 @@ def test_run_rename_when_resuming_jobs(self): out_file1: rename: "cat1 out" - tool_id: cat - state: - input1: - $link: first_fail#out_file1 + in: + input1: first_fail/out_file1 outputs: out_file1: rename: "#{input1} suffix" -test_data: - input1: - value: 1.fasta - type: File - name: fail +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fail """, history_id=history_id, wait=True, assert_ok=False) content = self.dataset_populator.get_history_dataset_details(history_id, hid=2, wait=True, assert_ok=False) name = content["name"] @@ -2331,17 +2286,16 @@ def test_run_rename_based_on_input_recursive(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 outputs: out_file1: rename: "#{input1} #{input1 | upper} suffix" -test_data: - input1: - value: 1.fasta - type: File - name: '#{input1}' +""", test_data=""" +input1: + value: 1.fasta + type: File + name: '#{input1}' """, history_id=history_id) content = self.dataset_populator.get_history_dataset_details(history_id, wait=True, assert_ok=True) name = content["name"] @@ -2367,15 +2321,15 @@ def test_run_rename_based_on_input_repeat(self): outputs: out_file1: rename: "#{queries_0.input2| basename} suffix" -test_data: - input1: - value: 1.fasta - type: File - name: fasta1 - input2: - value: 1.fasta - type: File - name: fasta2 +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fasta1 +input2: + value: 1.fasta + type: File + name: fasta2 """, history_id=history_id) content = self.dataset_populator.get_history_dataset_details(history_id, wait=True, assert_ok=True) name = content["name"] @@ -2403,17 +2357,17 @@ def test_run_rename_based_on_input_conditional(self): # Wish it was qualified for conditionals but it doesn't seem to be. -John # rename: "#{fastq_input.fastq_input1 | basename} suffix" rename: "#{fastq_input1 | basename} suffix" -test_data: - fasta_input: - value: 1.fasta - type: File - name: fasta1 - file_type: fasta - fastq_input: - value: 1.fastqsanger - type: File - name: fastq1 - file_type: fastqsanger +""", test_data=""" +fasta_input: + value: 1.fasta + type: File + name: fasta1 + file_type: fasta +fastq_input: + value: 1.fastqsanger + type: File + name: fastq1 + file_type: fastqsanger """, history_id=history_id) content = self.dataset_populator.get_history_dataset_details(history_id, wait=True, assert_ok=True) name = content["name"] @@ -2441,22 +2395,22 @@ def test_run_rename_based_on_input_collection(self): # Wish it was qualified for conditionals but it doesn't seem to be. -John # rename: "#{fastq_input.fastq_input1 | basename} suffix" rename: "#{fastq_input1} suffix" -test_data: - fasta_input: - value: 1.fasta - type: File - name: fasta1 - file_type: fasta - fastq_inputs: - type: list - name: the_dataset_pair - elements: - - identifier: forward - value: 1.fastq - type: File - - identifier: reverse - value: 1.fastq - type: File +""", test_data=""" +fasta_input: + value: 1.fasta + type: File + name: fasta1 + file_type: fasta +fastq_inputs: + type: list + name: the_dataset_pair + elements: + - identifier: forward + value: 1.fastq + type: File + - identifier: reverse + value: 1.fastq + type: File """, history_id=history_id) content = self.dataset_populator.get_history_dataset_details(history_id, wait=True, assert_ok=True) name = content["name"] @@ -2477,11 +2431,11 @@ def test_run_hide_on_collection_output(self): outputs: paired_output: hide: true -test_data: - input1: - value: 1.fasta - type: File - name: fasta1 +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fasta1 """, history_id=history_id) details1 = self.dataset_populator.get_history_collection_details(history_id, hid=4, wait=True, assert_ok=True) @@ -2506,14 +2460,14 @@ def test_run_hide_on_mapped_over_collection(self): outputs: out_file1: hide: true -test_data: - input1: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File +""", test_data=""" +input1: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File """, history_id=history_id) content = self.dataset_populator.get_history_dataset_details(history_id, hid=4, wait=True, assert_ok=True) @@ -2534,9 +2488,8 @@ def test_tag_auto_propagation(self): steps: - label: first_cat tool_id: cat - state: - input1: - $link: input1 + in: + input1: input1 outputs: out_file1: add_tags: @@ -2546,14 +2499,13 @@ def test_tag_auto_propagation(self): - "machine:illumina" - label: second_cat tool_id: cat - state: - input1: - $link: first_cat#out_file1 -test_data: - input1: - value: 1.fasta - type: File - name: fasta1 + in: + input1: first_cat/out_file1 +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fasta1 """, history_id=history_id) details0 = self.dataset_populator.get_history_dataset_details(history_id, hid=2, wait=True, assert_ok=True) @@ -2578,18 +2530,17 @@ def test_run_add_tag_on_collection_output(self): - id: input1 steps: - tool_id: collection_creates_pair - state: - input1: - $link: input1 + in: + input1: input1 outputs: paired_output: add_tags: - "name:foo" -test_data: - input1: - value: 1.fasta - type: File - name: fasta1 +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fasta1 """, history_id=history_id) details1 = self.dataset_populator.get_history_collection_details(history_id, hid=4, wait=True, assert_ok=True) @@ -2608,21 +2559,20 @@ def test_run_add_tag_on_mapped_over_collection(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 outputs: out_file1: add_tags: - "name:foo" -test_data: - input1: - type: list - name: the_dataset_list - elements: - - identifier: el1 - value: 1.fastq - type: File +""", test_data=""" +input1: + type: list + name: the_dataset_list + elements: + - identifier: el1 + value: 1.fastq + type: File """, history_id=history_id) details1 = self.dataset_populator.get_history_collection_details(history_id, hid=3, wait=True, assert_ok=True) @@ -2640,26 +2590,24 @@ def test_run_remove_tag_on_collection_output(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 outputs: out_file1: add_tags: - "name:foo" - tool_id: collection_creates_pair - state: - input1: - $link: first_cat#out_file1 + in: + input1: first_cat#out_file1 outputs: paired_output: remove_tags: - "name:foo" -test_data: - input1: - value: 1.fasta - type: File - name: fasta1 +""", test_data=""" +input1: + value: 1.fasta + type: File + name: fasta1 """, history_id=history_id) details_dataset_with_tag = self.dataset_populator.get_history_dataset_details(history_id, hid=2, wait=True, assert_ok=True) @@ -2707,24 +2655,21 @@ def test_run_with_runtime_pja(self): def test_run_with_delayed_runtime_pja(self): workflow_id = self._upload_yaml_workflow(""" class: GalaxyWorkflow +inputs: + - id: test_input steps: - - label: test_input - type: input - label: first_cat tool_id: cat1 - state: - input1: - $link: test_input + in: + input1: test_input - label: the_pause type: pause - connect: - input: - - first_cat#out_file1 + in: + input: first_cat/out_file1 - label: second_cat tool_id: cat1 - state: - input1: - $link: the_pause + in: + input1: the_pause """) downloaded_workflow = self._download_workflow(workflow_id) uuid_dict = dict((int(index), step["uuid"]) for index, step in downloaded_workflow["steps"].items()) @@ -2771,25 +2716,20 @@ def test_delete_intermediate_datasets_pja_1(self): steps: - tool_id: cat1 label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 - tool_id: cat1 label: second_cat - state: - input1: - $link: first_cat#out_file1 + in: + input1: first_cat/out_file1 - tool_id: cat1 label: third_cat - state: - input1: - $link: second_cat#out_file1 + in: + input1: second_cat/out_file1 outputs: out_file1: delete_intermediate_datasets: true -test_data: - input1: "hello world" -""", history_id=history_id) +""", test_data={"input1": "hello world"}, history_id=history_id) hda1 = self.dataset_populator.get_history_dataset_details(history_id, hid=1) hda2 = self.dataset_populator.get_history_dataset_details(history_id, hid=2) hda3 = self.dataset_populator.get_history_dataset_details(history_id, hid=3) @@ -3076,17 +3016,16 @@ def _run_mapping_workflow(self): steps: - label: cat1 tool_id: cat1 - state: - input1: - $link: input_c -test_data: - input_c: - type: list - elements: - - identifier: i1 - content: "0" - - identifier: i2 - content: "1" + in: + input1: input_c +""", test_data=""" +input_c: + type: list + elements: + - identifier: i1 + content: "0" + - identifier: i2 + content: "1" """, history_id=history_id, wait=True, assert_ok=True) workflow_id = summary.workflow_id invocation_id = summary.invocation_id diff --git a/test/api/test_workflows_from_yaml.py b/test/api/test_workflows_from_yaml.py index ef92e127e0b8..121c60b6239c 100644 --- a/test/api/test_workflows_from_yaml.py +++ b/test/api/test_workflows_from_yaml.py @@ -6,6 +6,10 @@ from base.populators import uses_test_history from base.workflow_fixtures import ( WORKFLOW_RUNTIME_PARAMETER_SIMPLE, + WORKFLOW_SIMPLE_CAT_AND_RANDOM_LINES, + WORKFLOW_SIMPLE_CAT_TWICE, + WORKFLOW_WITH_OUTPUT_ACTIONS, + WORKFLOW_WITH_OUTPUTS ) from .test_workflows import BaseWorkflowsApiTestCase @@ -24,29 +28,7 @@ def _upload_and_download(self, yaml_workflow): return workflow def test_simple_upload(self): - workflow = self._upload_and_download(""" -class: GalaxyWorkflow -steps: - - type: input - label: the_input - - tool_id: cat1 - state: - input1: - $link: 0 - - tool_id: cat1 - state: - input1: - $link: 1#out_file1 - - tool_id: random_lines1 - label: random_line_label - state: - num_lines: 10 - input: - $link: 2#out_file1 - seed_source: - seed_source_selector: set_seed - seed: asdf -""") + workflow = self._upload_and_download(WORKFLOW_SIMPLE_CAT_AND_RANDOM_LINES) tool_count = {'random_lines1': 0, 'cat1': 0} input_found = False @@ -92,26 +74,8 @@ def test_simple_upload(self): def test_simple_output_actions(self): history_id = self.dataset_populator.new_history() - self._run_jobs(""" -class: GalaxyWorkflow -steps: - - type: input - label: input1 - - tool_id: cat1 - label: first_cat - state: - input1: - $link: 0 - outputs: - out_file1: - hide: true - rename: "the new value" - - tool_id: cat1 - state: - input1: - $link: first_cat#out_file1 -test_data: - input1: "hello world" + self._run_jobs(WORKFLOW_WITH_OUTPUT_ACTIONS, test_data=""" +input1: "hello world" """, history_id=history_id) details1 = self.dataset_populator.get_history_dataset_details(history_id, hid=2) @@ -122,44 +86,12 @@ def test_simple_output_actions(self): def test_inputs_to_steps(self): history_id = self.dataset_populator.new_history() - self._run_jobs(""" -class: GalaxyWorkflow -inputs: - - id: input1 -steps: - - tool_id: cat1 - label: first_cat - connect: - input1: input1 - queries_0|input2: input1 - -test_data: - input1: "hello world" -""", history_id=history_id) + self._run_jobs(WORKFLOW_SIMPLE_CAT_TWICE, test_data={"input1": "hello world"}, history_id=history_id) contents1 = self.dataset_populator.get_history_dataset_content(history_id) self.assertEquals(contents1.strip(), "hello world\nhello world") def test_outputs(self): - workflow_id = self._upload_yaml_workflow(""" -class: GalaxyWorkflow -inputs: - - id: input1 -outputs: - - id: wf_output_1 - source: first_cat#out_file1 -steps: - - tool_id: cat1 - label: first_cat - state: - input1: - $link: input1 - queries: - - input2: - $link: input1 - -test_data: - input1: "hello world" -""") + workflow_id = self._upload_yaml_workflow(WORKFLOW_WITH_OUTPUTS) workflow = self._get("workflows/%s/download" % workflow_id).json() self.assertEquals(workflow["steps"]["1"]["workflow_outputs"][0]["output_name"], "out_file1") self.assertEquals(workflow["steps"]["1"]["workflow_outputs"][0]["label"], "wf_output_1") @@ -186,9 +118,8 @@ def test_subworkflow_simple(self): steps: - tool_id: cat1 label: first_cat - state: - input1: - $link: outer_input + in: + input1: outer_input - run: class: GalaxyWorkflow inputs: @@ -203,8 +134,8 @@ def test_subworkflow_simple(self): seed_source_selector: set_seed seed: asdf label: nested_workflow - connect: - inner_input: first_cat#out_file1 + in: + inner_input: first_cat/out_file1 test_data: outer_input: diff --git a/test/base/workflow_fixtures.py b/test/base/workflow_fixtures.py index 385912376150..45ee820d60a5 100644 --- a/test/base/workflow_fixtures.py +++ b/test/base/workflow_fixtures.py @@ -1,4 +1,28 @@ + +WORKFLOW_SIMPLE_CAT_AND_RANDOM_LINES = """ +class: GalaxyWorkflow +inputs: + - id: the_input +steps: + - tool_id: cat1 + in: + input1: the_input + - tool_id: cat1 + in: + input1: 1/out_file1 + - tool_id: random_lines1 + label: random_line_label + state: + num_lines: 10 + seed_source: + seed_source_selector: set_seed + seed: asdf + in: + input: 2/out_file1 +""" + + WORKFLOW_SIMPLE_CAT_TWICE = """ class: GalaxyWorkflow inputs: @@ -6,12 +30,9 @@ steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 - queries: - - input2: - $link: input1 + in: + input1: input1 + queries_0|input2: input1 """ @@ -46,13 +67,11 @@ type: input - label: split_up tool_id: collection_creates_pair - state: - input1: - $link: text_input + in: + input1: text_input - tool_id: collection_paired_test - state: - f1: - $link: split_up#paired_output + in: + f1: split_up/paired_output test_data: text_input: | a @@ -83,9 +102,8 @@ input1: $link: cat_inputs#out_file1 - tool_id: cat_list - state: - input1: - $link: split_up#split_output + in: + input1: split_up/split_output test_data: text_input1: | samp1\t10.0 @@ -99,15 +117,14 @@ WORKFLOW_SIMPLE_MAPPING = """ class: GalaxyWorkflow inputs: - - id: input1 - type: data_collection_input + input1: + type: collection collection_type: list steps: - tool_id: cat label: cat - state: - input1: - $link: input1 + in: + input1: input1 """ @@ -192,9 +209,8 @@ columns: [0, 1] - tool_id: collection_creates_list label: copy_list - state: - input1: - $link: apply#output + in: + input1: apply/output test_data: input_c: type: list @@ -216,9 +232,8 @@ steps: - tool_id: cat1 label: first_cat - state: - input1: - $link: outer_input + in: + input1: outer_input - run: class: GalaxyWorkflow inputs: @@ -237,8 +252,8 @@ seed_source_selector: set_seed seed: asdf label: nested_workflow - connect: - inner_input: first_cat#out_file1 + in: + inner_input: first_cat/out_file1 - tool_id: cat1 label: second_cat state: @@ -277,11 +292,30 @@ seed_source_selector: set_seed seed: asdf label: nested_workflow - connect: + in: inner_input: outer_input """ +WORKFLOW_WITH_OUTPUT_ACTIONS = """ +class: GalaxyWorkflow +inputs: + - id: input1 +steps: + - tool_id: cat1 + label: first_cat + outputs: + out_file1: + hide: true + rename: "the new value" + in: + input1: input1 + - tool_id: cat1 + in: + input1: first_cat/out_file1 +""" + + WORKFLOW_RUNTIME_PARAMETER_SIMPLE = """ class: GalaxyWorkflow inputs: @@ -306,9 +340,8 @@ steps: - label: the_pause type: pause - connect: - input: - - input1 + in: + input: input1 - tool_id: random_lines1 runtime_inputs: - num_lines @@ -373,13 +406,30 @@ steps: - tool_id: cat label: first_cat - state: - input1: - $link: inner_input + in: + input1: inner_input outputs: out_file1: rename: "${replaceme} suffix" label: nested_workflow - connect: + in: inner_input: outer_input """ + +WORKFLOW_WITH_OUTPUTS = """ +class: GalaxyWorkflow +inputs: + - id: input1 +outputs: + - id: wf_output_1 + source: first_cat#out_file1 +steps: + - tool_id: cat1 + label: first_cat + state: + input1: + $link: input1 + queries: + - input2: + $link: input1 +""" From 8ba76c9704a999eb51aa466e312d5b6aa1953066 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 1 Oct 2018 11:44:17 -0400 Subject: [PATCH 3/6] Switch to CWL-style format 2 workflow output definitions. --- test/api/test_workflows.py | 62 +++++++++++++++++----------------- test/base/workflow_fixtures.py | 28 +++++++-------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/test/api/test_workflows.py b/test/api/test_workflows.py index f280b1a2509b..3b28692024a8 100644 --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -77,8 +77,8 @@ inputs: - id: outer_input outputs: - - id: outer_output - source: second_cat#out_file1 + outer_output: + outputSource: second_cat/out_file1 steps: - tool_id: cat1 label: first_cat @@ -993,7 +993,7 @@ def test_run_subworkflow_replacment_parameters(self): value: 1.bed type: File """ - self._run_jobs(WORKFLOW_NESTED_REPLACEMENT_PARAMETER, test_data=test_data, history_id=history_id, round_trip_format_conversion=True) + self._run_jobs(WORKFLOW_NESTED_REPLACEMENT_PARAMETER, test_data=test_data, history_id=history_id) details = self.dataset_populator.get_history_dataset_details(history_id) assert details["name"] == "moocow suffix" @@ -1188,8 +1188,8 @@ def test_workflow_output_dataset(self): inputs: - id: input1 outputs: - - id: wf_output_1 - source: first_cat#out_file1 + wf_output_1: + outputSource: first_cat/out_file1 steps: - tool_id: cat1 label: first_cat @@ -1217,8 +1217,8 @@ def test_workflow_output_dataset_collection(self): type: data_collection_input collection_type: list outputs: - - id: wf_output_1 - source: first_cat#out_file1 + wf_output_1: + outputSource: first_cat/out_file1 steps: - tool_id: cat label: first_cat @@ -1257,8 +1257,8 @@ def test_workflow_input_mapping(self): inputs: - id: input1 outputs: - - id: wf_output_1 - source: first_cat#out_file1 + wf_output_1: + outputSource: first_cat/out_file1 steps: - tool_id: cat label: first_cat @@ -1299,8 +1299,8 @@ def test_workflow_run_input_mapping_with_output_collections(self): inputs: - id: text_input outputs: - - id: wf_output_1 - source: split_up#paired_output + wf_output_1: + outputSource: split_up/paired_output steps: - label: split_up tool_id: collection_creates_pair @@ -1381,8 +1381,8 @@ def test_subworkflow_recover_mapping_1(self): inputs: - id: outer_input outputs: - - id: outer_output - source: second_cat#out_file1 + outer_output: + outputSource: second_cat/out_file1 steps: - tool_id: cat1 label: first_cat @@ -1393,8 +1393,8 @@ def test_subworkflow_recover_mapping_1(self): inputs: - id: inner_input outputs: - - id: workflow_output - source: random_lines#out_file1 + workflow_output: + outputSource: random_lines/out_file1 steps: - tool_id: random_lines1 label: random_lines @@ -1439,8 +1439,8 @@ def test_subworkflow_recover_mapping_2(self): inputs: - id: outer_input outputs: - - id: outer_output - source: second_cat#out_file1 + outer_output: + outputSource: second_cat/out_file1 steps: - tool_id: cat1 label: first_cat @@ -1451,8 +1451,8 @@ def test_subworkflow_recover_mapping_2(self): inputs: - id: inner_input outputs: - - id: workflow_output - source: inner_cat#out_file1 + workflow_output: + outputSource: inner_cat/out_file1 steps: - tool_id: random_lines1 label: random_lines @@ -1496,8 +1496,8 @@ def test_recover_mapping_in_subworkflow(self): inputs: - id: outer_input outputs: - - id: outer_output - source: second_cat#out_file1 + outer_output: + outputSource: second_cat/out_file1 steps: - tool_id: cat1 label: first_cat @@ -1508,8 +1508,8 @@ def test_recover_mapping_in_subworkflow(self): inputs: - id: inner_input outputs: - - id: workflow_output - source: split#output + workflow_output: + outputSource: split/output steps: - tool_id: random_lines1 label: random_lines @@ -1548,8 +1548,8 @@ def test_empty_list_mapping(self): inputs: - id: input1 outputs: - - id: count_list - source: count_list#out_file1 + count_list: + outputSource: count_list/out_file1 steps: - tool_id: empty_list label: empty_list @@ -1604,8 +1604,8 @@ def test_empty_list_reduction(self): inputs: - id: input1 outputs: - - id: count_multi_file - source: count_multi_file#out_file1 + count_multi_file: + outputSource: count_multi_file/out_file1 steps: - tool_id: empty_list label: empty_list @@ -2092,8 +2092,8 @@ def test_optional_workflow_output(self): class: GalaxyWorkflow inputs: [] outputs: - - id: wf_output_1 - source: output_filter#out_1 + wf_output_1: + outputSource: output_filter/out_1 steps: - tool_id: output_filter label: output_filter @@ -2711,8 +2711,8 @@ def test_delete_intermediate_datasets_pja_1(self): inputs: - id: input1 outputs: - - id: wf_output_1 - source: third_cat#out_file1 + wf_output_1: + outputSource: third_cat/out_file1 steps: - tool_id: cat1 label: first_cat diff --git a/test/base/workflow_fixtures.py b/test/base/workflow_fixtures.py index 45ee820d60a5..23aa3c343382 100644 --- a/test/base/workflow_fixtures.py +++ b/test/base/workflow_fixtures.py @@ -227,8 +227,8 @@ inputs: - id: outer_input outputs: - - id: outer_output - source: second_cat#out_file1 + outer_output: + outputSource: second_cat/out_file1 steps: - tool_id: cat1 label: first_cat @@ -239,8 +239,8 @@ inputs: - id: inner_input outputs: - - id: workflow_output - source: random_lines#out_file1 + workflow_output: + outputSource: random_lines/out_file1 steps: - tool_id: random_lines1 label: random_lines @@ -270,16 +270,16 @@ inputs: - id: outer_input outputs: - - id: outer_output - source: nested_workflow#workflow_output + outer_output: + outputSource: nested_workflow/workflow_output steps: - run: class: GalaxyWorkflow inputs: - id: inner_input outputs: - - id: workflow_output - source: random_lines#out_file1 + workflow_output: + outputSource: random_lines#out_file1 steps: - tool_id: random_lines1 label: random_lines @@ -393,16 +393,16 @@ inputs: - id: outer_input outputs: - - id: outer_output - source: nested_workflow#workflow_output + outer_output: + outputSource: nested_workflow/workflow_output steps: - run: class: GalaxyWorkflow inputs: - id: inner_input outputs: - - id: workflow_output - source: first_cat#out_file1 + workflow_output: + outputSource: first_cat/out_file1 steps: - tool_id: cat label: first_cat @@ -421,8 +421,8 @@ inputs: - id: input1 outputs: - - id: wf_output_1 - source: first_cat#out_file1 + wf_output_1: + outputSource: first_cat/out_file1 steps: - tool_id: cat1 label: first_cat From fd251b16e8cf25d9c883745e8cbee1a178fd6e4e Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 1 Oct 2018 15:52:54 -0400 Subject: [PATCH 4/6] Rev gxformat2 dependencies to get latest features. --- .../dependencies/pipfiles/default/pinned-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt index 45c32b80c5e0..1e251d5f7945 100644 --- a/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt +++ b/lib/galaxy/dependencies/pipfiles/default/pinned-requirements.txt @@ -55,7 +55,7 @@ functools32==3.2.3.post2; python_version == '2.7' future==0.16.0 futures==3.2.0; python_version == '2.6' or python_version == '2.7' galaxy-sequence-utils==1.1.3 -gxformat2==0.3.0 +gxformat2==0.6.0 h5py==2.8.0 html5lib==1.0.1 idna==2.7 From 915c1a9b66a86485a42c4aab0ac1295924deda4e Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 1 Oct 2018 16:31:14 -0400 Subject: [PATCH 5/6] Remove unused variable in test_workflows. --- test/api/test_workflows.py | 42 -------------------------------------- 1 file changed, 42 deletions(-) diff --git a/test/api/test_workflows.py b/test/api/test_workflows.py index 3b28692024a8..de5128f5739e 100644 --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -30,48 +30,6 @@ from galaxy.exceptions import error_codes # noqa: I201 -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 - in: - input1: 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 - in: - 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 -""" - NESTED_WORKFLOW_AUTO_LABELS = """ class: GalaxyWorkflow inputs: From a8843ece349b0334353b9506169f82205f4928be Mon Sep 17 00:00:00 2001 From: John Chilton Date: Mon, 1 Oct 2018 16:42:23 -0400 Subject: [PATCH 6/6] Allow CWL-style id map for workflow inputs --- test/api/test_workflows.py | 111 +++++++++++++-------------- test/api/test_workflows_from_yaml.py | 4 +- test/base/workflow_fixtures.py | 40 +++++----- 3 files changed, 73 insertions(+), 82 deletions(-) diff --git a/test/api/test_workflows.py b/test/api/test_workflows.py index de5128f5739e..a89e21dc2f4a 100644 --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -33,7 +33,7 @@ NESTED_WORKFLOW_AUTO_LABELS = """ class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data outputs: outer_output: outputSource: second_cat/out_file1 @@ -1016,11 +1016,10 @@ def test_workflow_run_zip_collections(self): with self.dataset_populator.test_history() as history_id: workflow_id = self._upload_yaml_workflow(""" class: GalaxyWorkflow +inputs: + test_input_1: data + test_input_2: data steps: - - label: test_input_1 - type: input - - label: test_input_2 - type: input - label: first_cat tool_id: cat1 state: @@ -1088,8 +1087,8 @@ def test_filter_failed_mapping(self): summary = self._run_jobs(""" class: GalaxyWorkflow inputs: - - type: collection - label: input_c + input_c: collection + steps: - label: mixed_collection tool_id: exit_code_from_file @@ -1144,7 +1143,7 @@ def test_workflow_output_dataset(self): summary = self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data outputs: wf_output_1: outputSource: first_cat/out_file1 @@ -1171,7 +1170,7 @@ def test_workflow_output_dataset_collection(self): summary = self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: type: data_collection_input collection_type: list outputs: @@ -1213,7 +1212,7 @@ def test_workflow_input_mapping(self): summary = self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data outputs: wf_output_1: outputSource: first_cat/out_file1 @@ -1255,7 +1254,7 @@ def test_workflow_run_input_mapping_with_output_collections(self): summary = self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: text_input + text_input: data outputs: wf_output_1: outputSource: split_up/paired_output @@ -1337,7 +1336,7 @@ def test_subworkflow_recover_mapping_1(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data outputs: outer_output: outputSource: second_cat/out_file1 @@ -1349,7 +1348,7 @@ def test_subworkflow_recover_mapping_1(self): - run: class: GalaxyWorkflow inputs: - - id: inner_input + inner_input: data outputs: workflow_output: outputSource: random_lines/out_file1 @@ -1395,7 +1394,7 @@ def test_subworkflow_recover_mapping_2(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data outputs: outer_output: outputSource: second_cat/out_file1 @@ -1407,7 +1406,7 @@ def test_subworkflow_recover_mapping_2(self): - run: class: GalaxyWorkflow inputs: - - id: inner_input + inner_input: data outputs: workflow_output: outputSource: inner_cat/out_file1 @@ -1452,7 +1451,7 @@ def test_recover_mapping_in_subworkflow(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data outputs: outer_output: outputSource: second_cat/out_file1 @@ -1464,7 +1463,7 @@ def test_recover_mapping_in_subworkflow(self): - run: class: GalaxyWorkflow inputs: - - id: inner_input + inner_input: data outputs: workflow_output: outputSource: split/output @@ -1504,7 +1503,7 @@ def test_empty_list_mapping(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data outputs: count_list: outputSource: count_list/out_file1 @@ -1538,9 +1537,9 @@ def test_mapping_and_subcollection_mapping(self): with self.dataset_populator.test_history() as history_id: jobs_summary = self._run_jobs(""" class: GalaxyWorkflow +inputs: + text_input1: collection steps: - - label: text_input1 - type: input_collection - tool_id: collection_type_source_map_over in: input_collect: text_input1 @@ -1560,7 +1559,7 @@ def test_empty_list_reduction(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data outputs: count_multi_file: outputSource: count_multi_file/out_file1 @@ -1735,8 +1734,8 @@ def test_pause_outputs_with_deleted_inputs(self): workflow_id = self._upload_yaml_workflow(""" class: GalaxyWorkflow inputs: - - id: input1 - type: data_collection_input + input1: + type: collection collection_type: list steps: - tool_id: cat @@ -1775,9 +1774,9 @@ def test_run_with_implicit_connection(self): with self.dataset_populator.test_history() as history_id: run_summary = self._run_jobs(""" class: GalaxyWorkflow +inputs: + test_input: data steps: -- label: test_input - type: input - label: first_cat tool_id: cat1 in: @@ -1823,8 +1822,7 @@ def test_run_with_validated_parameter_connection_valid(self): run_summary = self._run_jobs(""" class: GalaxyWorkflow inputs: - - label: text_input - type: text + text_input: text steps: - tool_id: validation_repeat state: @@ -1846,8 +1844,7 @@ def test_run_with_validated_parameter_connection_invalid(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - label: text_input - type: text + text_input: text steps: - tool_id: validation_repeat state: @@ -1865,10 +1862,8 @@ def test_run_with_text_connection(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - label: data_input - type: data - - label: text_input - type: text + data_input: data + text_input: text steps: - label: randomlines tool_id: random_lines1 @@ -2071,8 +2066,8 @@ def test_run_rename_on_mapped_over_collection(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 - type: data_collection_input + input1: + type: collection collection_type: list steps: - tool_id: cat @@ -2106,8 +2101,8 @@ def test_run_rename_based_on_inputs_on_mapped_over_collection(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 - type: data_collection_input + input1: + type: collection collection_type: list steps: - tool_id: cat @@ -2137,7 +2132,7 @@ def test_run_rename_collection_output(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: collection_creates_pair in: @@ -2193,7 +2188,7 @@ def test_run_rename_when_resuming_jobs(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: fail_identifier label: first_fail @@ -2240,7 +2235,7 @@ def test_run_rename_based_on_input_recursive(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: cat label: first_cat @@ -2265,8 +2260,8 @@ def test_run_rename_based_on_input_repeat(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 - - id: input2 + input1: data + input2: data steps: - tool_id: cat label: first_cat @@ -2299,8 +2294,8 @@ def test_run_rename_based_on_input_conditional(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: fasta_input - - id: fastq_input + fasta_input: data + fastq_input: data steps: - tool_id: mapper2 state: @@ -2337,8 +2332,8 @@ def test_run_rename_based_on_input_collection(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: fasta_input - - id: fastq_inputs + fasta_input: data + fastq_inputs: data steps: - tool_id: mapper2 state: @@ -2380,7 +2375,7 @@ def test_run_hide_on_collection_output(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: collection_creates_pair state: @@ -2412,9 +2407,8 @@ def test_run_hide_on_mapped_over_collection(self): steps: - tool_id: cat label: first_cat - state: - input1: - $link: input1 + in: + input1: input1 outputs: out_file1: hide: true @@ -2442,7 +2436,7 @@ def test_tag_auto_propagation(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - label: first_cat tool_id: cat @@ -2485,7 +2479,7 @@ def test_run_add_tag_on_collection_output(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: collection_creates_pair in: @@ -2511,8 +2505,8 @@ def test_run_add_tag_on_mapped_over_collection(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 - type: data_collection_input + input1: + type: collection collection_type: list steps: - tool_id: cat @@ -2544,7 +2538,7 @@ def test_run_remove_tag_on_collection_output(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: cat label: first_cat @@ -2614,7 +2608,7 @@ def test_run_with_delayed_runtime_pja(self): workflow_id = self._upload_yaml_workflow(""" class: GalaxyWorkflow inputs: - - id: test_input + test_input: data steps: - label: first_cat tool_id: cat1 @@ -2667,7 +2661,7 @@ def test_delete_intermediate_datasets_pja_1(self): self._run_jobs(""" class: GalaxyWorkflow inputs: - - id: input1 + input1: data outputs: wf_output_1: outputSource: third_cat/out_file1 @@ -2969,8 +2963,7 @@ def _run_mapping_workflow(self): summary = self._run_jobs(""" class: GalaxyWorkflow inputs: - - type: collection - label: input_c + input_c: collection steps: - label: cat1 tool_id: cat1 diff --git a/test/api/test_workflows_from_yaml.py b/test/api/test_workflows_from_yaml.py index 121c60b6239c..76b9d56eac85 100644 --- a/test/api/test_workflows_from_yaml.py +++ b/test/api/test_workflows_from_yaml.py @@ -114,7 +114,7 @@ def test_subworkflow_simple(self): workflow_id = self._upload_yaml_workflow(""" class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data steps: - tool_id: cat1 label: first_cat @@ -123,7 +123,7 @@ def test_subworkflow_simple(self): - run: class: GalaxyWorkflow inputs: - - id: inner_input + inner_input: data steps: - tool_id: random_lines1 state: diff --git a/test/base/workflow_fixtures.py b/test/base/workflow_fixtures.py index 23aa3c343382..34bdaedb16d9 100644 --- a/test/base/workflow_fixtures.py +++ b/test/base/workflow_fixtures.py @@ -26,7 +26,7 @@ WORKFLOW_SIMPLE_CAT_TWICE = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: cat label: first_cat @@ -39,7 +39,7 @@ WORKFLOW_WITH_OLD_TOOL_VERSION = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: multiple_versions tool_version: "0.0.1" @@ -51,7 +51,7 @@ WORKFLOW_WITH_INVALID_STATE = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: multiple_versions tool_version: "0.0.1" @@ -62,9 +62,9 @@ WORKFLOW_WITH_OUTPUT_COLLECTION = """ class: GalaxyWorkflow +inputs: + text_input: data steps: - - label: text_input - type: input - label: split_up tool_id: collection_creates_pair in: @@ -150,8 +150,7 @@ WORKFLOW_WITH_RULES_1 = """ class: GalaxyWorkflow inputs: - - type: collection - label: input_c + input_c: collection steps: - label: apply tool_id: __APPLY_RULES__ @@ -190,8 +189,7 @@ WORKFLOW_WITH_RULES_2 = """ class: GalaxyWorkflow inputs: - - type: collection - label: input_c + input_c: collection steps: - label: apply tool_id: __APPLY_RULES__ @@ -225,7 +223,7 @@ WORKFLOW_NESTED_SIMPLE = """ class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data outputs: outer_output: outputSource: second_cat/out_file1 @@ -237,7 +235,7 @@ - run: class: GalaxyWorkflow inputs: - - id: inner_input + inner_input: data outputs: workflow_output: outputSource: random_lines/out_file1 @@ -268,7 +266,7 @@ WORKFLOW_NESTED_RUNTIME_PARAMETER = """ class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data outputs: outer_output: outputSource: nested_workflow/workflow_output @@ -276,7 +274,7 @@ - run: class: GalaxyWorkflow inputs: - - id: inner_input + inner_input: data outputs: workflow_output: outputSource: random_lines#out_file1 @@ -300,7 +298,7 @@ WORKFLOW_WITH_OUTPUT_ACTIONS = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: cat1 label: first_cat @@ -319,7 +317,7 @@ WORKFLOW_RUNTIME_PARAMETER_SIMPLE = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: random_lines1 runtime_inputs: @@ -336,7 +334,7 @@ WORKFLOW_RUNTIME_PARAMETER_AFTER_PAUSE = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - label: the_pause type: pause @@ -356,7 +354,7 @@ WORKFLOW_RENAME_ON_INPUT = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: cat label: first_cat @@ -376,7 +374,7 @@ WORKFLOW_RENAME_ON_REPLACEMENT_PARAM = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data steps: - tool_id: cat label: first_cat @@ -391,7 +389,7 @@ WORKFLOW_NESTED_REPLACEMENT_PARAMETER = """ class: GalaxyWorkflow inputs: - - id: outer_input + outer_input: data outputs: outer_output: outputSource: nested_workflow/workflow_output @@ -399,7 +397,7 @@ - run: class: GalaxyWorkflow inputs: - - id: inner_input + inner_input: data outputs: workflow_output: outputSource: first_cat/out_file1 @@ -419,7 +417,7 @@ WORKFLOW_WITH_OUTPUTS = """ class: GalaxyWorkflow inputs: - - id: input1 + input1: data outputs: wf_output_1: outputSource: first_cat/out_file1