Files
galaxy/test/functional/tools/output_format.xml
T
John Chilton ec24396140 Refactoring: Start abstracting XML processing out of Tool and param classes.
Long term this could allow Galaxy to support - multiple tooling formats (Galaxy-like YAML, CWL http://bit.ly/cwltooldesc, etc...). But I think it is also important from a purely design perspective - this is a core logic class integrating different components - they should not also be doing XML parsing.

To verify the interface for parsing tools is expressive enough to allow multiple useful implementations, I built a test YAML tool description that implements many of the same features as Galaxy but smooths out rough edges (uses exit codes for job failure by default for instance). Loading these tools is disabled by default and it is not documented how to enable them because they are not intended to be part of Galaxy's public API.
2014-12-11 00:26:13 -05:00

73 lines
3.1 KiB
XML

<tool id="output_format" name="output_format" version="1.0.0">
<command>
echo "test" > 1;
echo "test" > 2;
echo "test" > 3;
echo "test" > 4;
echo "test" > 5;
</command>
<inputs>
<param name="input_data_1" type="data" format="data" />
<param name="input_data_2" type="data" format="data" />
<param name="input_text" type="text" value="1" />
</inputs>
<outputs>
<data format="txt" from_work_dir="1" name="direct_output" />
<!-- TODO: fixme, following input gets random type fastqsanger or
fastqsolexa. -->
<data format="input" from_work_dir="2" name="input_based_output" />
<data format="txt" from_work_dir="3" name="format_source_1_output" format_source="input_data_1" />
<data format="txt" from_work_dir="4" name="format_source_2_output" format_source="input_data_2" />
<data format="txt" from_work_dir="5" name="change_format_output">
<change_format>
<when input="input_text" value="foo" format="fastqsolexa" />
<when input="input_text" value="bar" format="fastqillumina" />
</change_format>
</data>
</outputs>
<tests>
<test>
<param name="input_data_1" value="1.fastqsanger" ftype="fastqsanger" />
<param name="input_data_2" value="1.fastqsolexa" ftype="fastqsolexa" />
<param name="input_text" value="foo" />
<output name="direct_output" ftype="txt">
<assert_contents><has_line line="test" /></assert_contents>
</output>
<!-- In this case input_based_output ftype is "randomly" either
fastqsanger or fastqsolexa -->
<output name="format_source_1_output" ftype="fastqsanger">
<assert_contents><has_line line="test" /></assert_contents>
</output>
<output name="format_source_2_output" ftype="fastqsolexa">
<assert_contents><has_line line="test" /></assert_contents>
</output>
<!-- input_text == bar => format set to fastsolexa -->
<output name="change_format_action" ftype="fastqsolexa">
<assert_contents><has_line line="test" /></assert_contents>
</output>
</test>
<test>
<param name="input_data_1" value="1.fastqsanger" ftype="fastqsanger" />
<param name="input_data_2" value="1.fastqsanger" ftype="fastqsanger" />
<param name="input_text" value="bar" />
<output name="input_based_output" ftype="fastqsanger">
<assert_contents><has_line line="test" /></assert_contents>
</output>
<!-- input_text == bar => format set to fastqillumina -->
<output name="change_format_action" ftype="fastqillumina">
<assert_contents><has_line line="test" /></assert_contents>
</output>
</test>
<test>
<param name="input_data_1" value="1.fastqsanger" ftype="fastqsanger" />
<param name="input_data_2" value="1.fastqsanger" ftype="fastqsanger" />
<param name="input_text" value="not_foo_or_bar" />
<!-- input_text doesn't match any when, default to explicitly declared
type. -->
<output name="change_format_action" ftype="txt">
<assert_contents><has_line line="test" /></assert_contents>
</output>
</test>
</tests>
</tool>