1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/02852a8e49e2/ Changeset: 02852a8e49e2 User: jmchilton Date: 2014-09-08 16:33:54 Summary: Add very basic functional tests for tool param validation. Including same test with workflow parameter substition - gotta admit I thought that workflow test was going to fail - so this week is looking pretty good :). Affected #: 5 files diff -r f295824b2f9eb38d3de1121b63dc8a19f54ee0e9 -r 02852a8e49e23cd1090f798e99702057fa24bc1d test/api/test_workflow_validation_1.ga --- /dev/null +++ b/test/api/test_workflow_validation_1.ga @@ -0,0 +1,33 @@ +{ + "a_galaxy_workflow": "true", + "annotation": "", + "format-version": "0.1", + "name": "test_validation_1", + "steps": { + "0": { + "annotation": "", + "id": 0, + "input_connections": {}, + "inputs": [], + "name": "Validation (default)", + "outputs": [ + { + "name": "out_file1", + "type": "data" + } + ], + "position": { + "left": 10, + "top": 10 + }, + "post_job_actions": {}, + "tool_errors": null, + "tool_id": "validation_default", + "tool_state": "{\"__page__\": 0, \"__rerun_remap_job_id__\": null, \"input1\": \"\\\"cow\\\"\", \"chromInfo\": \"\\\"/home/john/workspace/galaxy-central/tool-data/shared/ucsc/chrom/?.len\\\"\"}", + "tool_version": null, + "type": "tool", + "user_outputs": [] + } + }, + "uuid": "d058c6a0-6d70-44f4-a177-01859fc6aa37" +} \ No newline at end of file diff -r f295824b2f9eb38d3de1121b63dc8a19f54ee0e9 -r 02852a8e49e23cd1090f798e99702057fa24bc1d test/api/test_workflows.py --- a/test/api/test_workflows.py +++ b/test/api/test_workflows.py @@ -478,6 +478,21 @@ self.__assert_lines_hid_line_count_is( history_id, 2, 5 ) self.__assert_lines_hid_line_count_is( history_id, 3, 5 ) + @skip_without_tool( "validation_default" ) + def test_parameter_substitution_validation( self ): + workflow = self.workflow_populator.load_workflow_from_resource( "test_workflow_validation_1" ) + uploaded_workflow_id = self.workflow_populator.create_workflow( workflow ) + history_id = self.dataset_populator.new_history() + workflow_request = dict( + history="hist_id=%s" % history_id, + workflow_id=uploaded_workflow_id, + parameters=dumps( dict( validation_default=dict( input1="\" ; echo \"moo" ) ) ) + ) + run_workflow_response = self._post( "workflows", data=workflow_request ) + self._assert_status_code_is( run_workflow_response, 200 ) + self.dataset_populator.wait_for_history( history_id, assert_ok=True ) + self.assertEquals("__dq__ X echo __dq__moo\n", self.dataset_populator.get_history_dataset_content( history_id ) ) + @skip_without_tool( "random_lines1" ) def test_run_replace_params_by_steps( self ): workflow_request, history_id = self._setup_random_x2_workflow( "test_for_replace_step_params" ) diff -r f295824b2f9eb38d3de1121b63dc8a19f54ee0e9 -r 02852a8e49e23cd1090f798e99702057fa24bc1d test/functional/tools/for_workflows/head.xml --- a/test/functional/tools/for_workflows/head.xml +++ b/test/functional/tools/for_workflows/head.xml @@ -1,6 +1,6 @@ <tool id="head" name="Select first"><description>lines from a dataset</description> - <command>head $input $lineNum > $out_file1</command> + <command>head -n $lineNum $input > $out_file1</command><inputs><param name="lineNum" size="5" type="integer" value="10" label="Select first" help="lines"/><param format="txt" name="input" type="data" label="from"/> diff -r f295824b2f9eb38d3de1121b63dc8a19f54ee0e9 -r 02852a8e49e23cd1090f798e99702057fa24bc1d test/functional/tools/samples_tool_conf.xml --- a/test/functional/tools/samples_tool_conf.xml +++ b/test/functional/tools/samples_tool_conf.xml @@ -21,6 +21,7 @@ <tool file="implicit_default_conds.xml" /><tool file="multi_data_param.xml" /><tool file="special_params.xml" /> + <tool file="validation_default.xml" /><tool file="collection_paired_test.xml" /><tool file="collection_nested_test.xml" /><tool file="collection_mixed_param.xml" /> diff -r f295824b2f9eb38d3de1121b63dc8a19f54ee0e9 -r 02852a8e49e23cd1090f798e99702057fa24bc1d test/functional/tools/validation_default.xml --- /dev/null +++ b/test/functional/tools/validation_default.xml @@ -0,0 +1,23 @@ +<tool id="validation_default" name="Validation (default)"> + <command> + echo "$input1" > out1; + </command> + <inputs> + <param name="input1" type="text" label="Concatenate Dataset" /> + </inputs> + <outputs> + <data name="out_file1" from_work_dir="out1" /> + </outputs> + <tests> + <test> + <param name="input1" value="" ; echo "moo" /> + <output name="out_file1"> + <assert_contents> + <has_line line="__dq__ X echo __dq__moo" /> + </assert_contents> + </output> + </test> + </tests> + <help> + </help> +</tool> 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.